0
특성이있는 요소를 고려합니다. 이 특성은 열거 형의 값만 가질 수 있습니다.XSD 요소 및 열거 형
이 요소의 아들을 열거 형 값으로 조건부로 조절할 수 있습니까? 금지 내 영어는 매우 :)
<xs:element minOccurs="0" name="datas">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element maxOccurs="1" name="data">
<xs:complexType>
<xs:attribute name="tag" type="xs:string" use="required"/>
<xs:attribute name="expr" type="xs:string" use="required"/>
<xs:attribute name="format" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="choice1"/>
<xs:enumeration value="choice2"/>
<xs:enumeration value="choice3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<!-- HERE IS SOME SONS -->
<xs:element name="element1" />
<xs:element name="element2" />
<xs:element name="element3" />
</xs:element>
</xs:sequence>
</xs:complexType>
나는 "choice1"를 선택하면
, 내가 필요한에서에서 element1있을 것입니다 좋은, 그리고이 element2/element3하지 않기 때문에는, 예를 들어 있습니다. "choice2"를 선택하면 필요한 요소 2가 생깁니다.
가능한지 알고 계십니까? 대답
답변 해 주셔서 감사합니다. 내 선생님 중 한 명이 나를 설명해주었습니다. 아마도 우는 참고 문헌이있는 백도어를 사용할 수 있습니다. 예를 들어 element1이 값이 choice1 인 속성에 대한 참조이고이 참조는이 속성의 choice1 값의 각 발생에 대해 필수임을 지정하십시오. – BaptX