0
그래서 나는이 인 data.xml 스키마 코드가 "잘못된 내용이 발견되었다"XML 스키마 :
<?xml version="1.0" encoding="UTF-8"?>
<j:data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jeresapp.dk data.xsd" xmlns:j="http://example.com">
<j:item>
<j:title>test title</j:title>
<j:backgroundcolor>#aaf8941e</j:backgroundcolor>
<j:fontcolor>#ffffff</j:fontcolor>
<j:type>header</j:type>
</j:item>
</j:data>
내가 원하는 :이 test.xml의 파일이
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com" elementFormDefault="qualified">
<xs:element name="data">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="type" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="header"/>
<xs:enumeration value="normal"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="backgroundcolor" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="#[0-9A-Fa-f]+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="fontcolor" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="#[0-9A-Fa-f]+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
을 0- 무한 수 항목
각 항목은 정의 된 각 하위 요소 중 0-1 개를 포함 할 수 있습니다 (예 : 제목 및 FONTCOLOR)
좀 rrros (내가 스키마에 새로운 오전, 내가 가서 내가 여러 XSD 유효성 검사 도구에서 이상한 오류의 BI를 얻고있다) 따기입니다 tthrough 근무하는 동안:
'j : type'요소로 시작하는 잘못된 콘텐츠가 발견되었습니다. 이 시점에서 자식 요소가 필요하지 않습니다.