다음 xml 스키마를 구문 분석하면xml 열거 형 및 공용 형식의 단순 형식
요소 특성 : 스키마 구문 분석기 오류 : 특성 선언이 생성됩니다. 'current-state', attribute 'type': QName 값 'covered-state'가 (n) 단순 유형 정의로 해석되지 않습니다. WXS 스키마 memory.xsd 컴파일하는 데 실패
을 heres 책임 코드 : XML 파일이 "0"을 받아들이도록
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com">
<xsd:simpleType name="covered-state">
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="xsd:integer">
<xsd:enumeration value="0"/>
<xsd:enumeration value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="COVERED"/>
<xsd:enumeration value="UNCOVERED"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>
<xsd:complexType name="MemoryCard">
<xsd:attribute name="current-state" type="covered-state" use="required"/> <!-- here i get the error -->
</xsd:complexType>
</xsd:schema>
그래서 이것은 어떻게해야 무엇 문자열과의 int의 열거 노동 조합이다 속성 현재 상태에 대해 "1"또는 "COVERED"또는 "UNCOVERED".
누군가 나를 올바른 방향으로 안내 할 수 있습니까? 감사!
음 괜찮아요. 나는 이미 작동하도록 만들었습니다. ID는 답변을 게시하고 싶지만 새 사용자 ID는 8 시간을 더 기다려야합니다. 아마 내가 그걸 게시 할 것임을 기억한다면. 어쩌면 비슷한 문제를 가진 사람을 도울 수 있습니다. – hooch