[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Look-up tables in XML Schema

  • From: "John Avery" <j.avery@b...>
  • To: <xml-dev@l...>
  • Date: Fri, 02 Feb 2007 16:00:22 +1100

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.