Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Look-up tables in XML Schema

From: "John Avery" <j.avery@--------.---.-->
To: <xml-dev@-----.---.--->
Date: 2/2/2007 5:01:00 AM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent