A
Andrew L
Hello all,
I'm new to XML schema design, and I've got a problem which I need some help
with. I have a simple type which describes a list of valid categories. I
also have another type which describes a list of all known subcategories.
However only a subset of the subcategories will be valid and this depends
on the value of the main category.
eg If category is cat1, then the only valid subcategories are scat1, scat2.
How and where can I put in a conditional operator in my schema?
<xs:simpleType name="category">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="cat1"/>
<xs:enumeration value="cat2"/>
<xs:enumeration value="cat3"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="category">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="scat1"/>
<xs:enumeration value="scat2"/>
<xs:enumeration value="scat3"/>
<xs:enumeration value="scat4"/>
<xs:enumeration value="scat5"/>
</xs:restriction>
</xs:simpleType>
Many thanks for your help
Andrew
I'm new to XML schema design, and I've got a problem which I need some help
with. I have a simple type which describes a list of valid categories. I
also have another type which describes a list of all known subcategories.
However only a subset of the subcategories will be valid and this depends
on the value of the main category.
eg If category is cat1, then the only valid subcategories are scat1, scat2.
How and where can I put in a conditional operator in my schema?
<xs:simpleType name="category">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="cat1"/>
<xs:enumeration value="cat2"/>
<xs:enumeration value="cat3"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="category">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="scat1"/>
<xs:enumeration value="scat2"/>
<xs:enumeration value="scat3"/>
<xs:enumeration value="scat4"/>
<xs:enumeration value="scat5"/>
</xs:restriction>
</xs:simpleType>
Many thanks for your help
Andrew