0
관심의
다음 XML 하위 요소입니다 : 나는 가능한 값을 열거하고 싶습니다 XML 요소 열거 속성과 열거 값
<optInItem type='MARKETING_EMAILS'>NO</optInItem>
(2 개 가능한 값을 가정) 속성 '유형'에 대한 가능한 열거는 optInItem의 텍스트 값에 대한 값 (값은 Yes | No 일 수 있음). 나는 다음 xsd로 시작하지만 두 개의 별도 열거 형을 추가하는 방법을 모르겠다.
<xs:element name="optInItem" maxOccurs="2" minOccurs="2">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="type" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
어떤 제안이나 조언을 부탁드립니다.
<xs:element name="account">
<xs:complexType>
<xs:sequence>
<xs:element type="optInItemType" name="optInItem" maxOccurs="2" minOccurs="2">
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="optInItemType">
<xs:simpleContent>
<xs:extension base="elementOptInItemType">
<xs:attribute name="type" type="attrOptInItemType"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="elementOptInItemType">
<xs:restriction base="xs:string">
<xs:enumeration value="YES"/>
<xs:enumeration value="NO"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="attrOptInItemType">
<xs:restriction base="xs:string">
<xs:enumeration value="MARKETING_EMAILS"/>
<xs:enumeration value="UPDATE_NOTIFICATIONS"/>
</xs:restriction>
</xs:simpleType>
내가 생각했던 것보다 더 복잡 : 다음 트릭을하는 것처럼
덕분에 많은 반복 후