2
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="game">
<xsd:complexType>
<xsd:all>
<xsd:element name="info" type="infoType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="infoType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="players" minOccurs="0" maxOccurs="1">
<xsd:complexType mixed="true">
<xsd:attribute name= "number" type="playernum"/>
<!-- xsd:element name="screenname" type="xsd:string">
<xsd:complexType>
<xsd:attribute name= "player" type="playernum"/>
</xsd:complexType>
</xsd:element -->
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="playernum">
<xsd:restriction base="xsd:int">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="4"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>infoType
해당 코드가 주석 처리 된 것입니다.XSD 중첩 요소
이 에러 출력을 생성:
game.xsd : 26 : 소자 요소 : 스키마 파서 오류 : 요소 '{http://www.w3.org/2001/XMLSchema}complexType' 내용이 유효하지 않습니다 . 예상되는 것은? (annotation ?, (simpleContent | complexContent | (group | all | choice | sequence) ?, (attribute | attributeGroup) *, anyAttribute?
문제의 요소에는 기본적으로 complexContent가있는 complextType이 포함되어 있습니다. 도움을 주시면 대단히 감사하겠습니다. 미리 감사드립니다.
이 꽤 있었다 나는 XSD 새로운 오전, 감사 않았다 분명하지만, 당신이 나의 영원한 감사를, 좋은 선생님 ;-) – Hut