Hello to all experts.
The problem that i have is related with this xml:
<RootNode>
<SubNode type="test1">
<AgainSubNode />
<AgainSubNode />
</SubNode>
<SubNode type="test2">
<AgainSubNode />
<AgainSubNode />
</SubNode>
I want to validate the xml using only xsd schema. The validation i have problem with is validating the xml file against the value of the attribute type. I have declared it as
<xs:simpleType name="Types">
<xs:restriction base="xs:string">
<xs:enumeration value="test1" />
<xs:enumeration value="test2" />
</xs:restriction>
</xs:simpleType>
</RootNode>
Is it possible to write something like this:
- if type = test1 then SubNode must have only one AgainSubNode node
- if type = test2 then subNode must have at least 3 AgainSubNode nodes
Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.