[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Look-up tables in XML Schema
Howdy folks, I am trying to represent a data type which is effectively a lookup table. Elements which have this lookup table as their type will have two (and only two) children, one being the index of the lookup table, the second being the value. It is trivial to ensure that all the values of the first child come from the index datatype and all the values of the second child come from the "value" datatype. But I can't seem to think of a way that I can ensure that the value of the index child matches the value of the lookup child. Note that I can't confine the names of the children, I want to be able to say things like: <element name="A" type="countrylookup"/> <element name="B" type="countrylookup"/> with country lookup defined in such a way that the following are valid: <A> <a1>AU</a1> <a2>Australia</a2> </A> <B> <b1>US</b1> <b2>United States</b2> </B> whereas the following are invalid: <A> <a1>US</a1> <a2>Australia</a2> </A> <B> <b1>AU</b1> <b2>United States</b2> </B> Note the tag naming requirement isn't based on a whim; I'm working with a legacy system which produces data in an XML format and can convert this XML data into another messaging format (HL7 vertical bar (aka er7)), changing the names of the tags will break the old system. I am aware of alternate solutions (e.g. transalte the old XML into a new format, validate data in that format, then translate back, or rewrite the old system) but if it is possible I would like to stick with providing a new "tighter" schema for the exisitng XML. Are these kind of constraints possible? Regards, John Avery
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|