bernardmanning
Programmer
Hi,
I'm a relative newbie when it comes to XML and have produced some XML files and schemas with some very simple enumerated values for various schemas.
However I've got a situation and I'm not quite sure what's the best way to go about solving it.
Previously, when I wanted to validate data in an element, I used an enumeration value eg
However, I've got a problem in that I need to validate data not on one value but two, eg
I need to represent a table of chemical elements, this would contain the chemical element abbreviation and description. eg
Abbreviation Description
Pb Lead
Cr Chromium
W Tungsten
I need to be able to validate each element to say, for instance, that if the abbreviation is 'Pb' then the description MUST be "Lead"
It wouldn't be acceptable to have an abbreviation of 'Pb' and a description of 'Tungsten'
Could anybody give me any information about how to go about this?
Thanks in advance, Berny
I'm a relative newbie when it comes to XML and have produced some XML files and schemas with some very simple enumerated values for various schemas.
However I've got a situation and I'm not quite sure what's the best way to go about solving it.
Previously, when I wanted to validate data in an element, I used an enumeration value eg
Code:
<xs:element name="Stock_category">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="On Order"/>
<xs:enumeration value="Received"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
I need to represent a table of chemical elements, this would contain the chemical element abbreviation and description. eg
Abbreviation Description
Pb Lead
Cr Chromium
W Tungsten
I need to be able to validate each element to say, for instance, that if the abbreviation is 'Pb' then the description MUST be "Lead"
It wouldn't be acceptable to have an abbreviation of 'Pb' and a description of 'Tungsten'
Could anybody give me any information about how to go about this?
Thanks in advance, Berny