Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Look-up tables in XML Schema

From: "Stephen Green" <stephengreenubl@-----.--->
To: "John Avery" <j.avery@--------.---.-->
Date: 2/2/2007 9:56:00 AM
Hi John

One of the options you might want to look at is OASIS CAM
- see jCAM and CAM Editor http://jcam.org.uk/

There are also some nice CAM examples in the recently
released UBL help pack freeb-ubl
http://xml.coverpages.org/freeb-ubl-Announce.html
http://downloads.sourceforge.net/freeb-ubl/freeb-ubl-kit-v1-0.zip
and these inlcude some look up tables similar to the ones you
have but defining them in CAM allows them to cater for your
base schema and allows subsetting too.

Another option is taking the approach of UBL' s codelist
methodology which uses schematron. Even a mixture of the
two might be feasible. With the CAM examples above the lookups
are generated from the UBL codelists which are defined in what
is called genericode format http://www.genericode.org/ .
http://docs.oasis-open.org/ubl/os-UBL-2.0/cl/gc/
The UBL codelist validation is found at
http://docs.oasis-open.org/ubl/os-UBL-2.0/val/
and the methodology at
http://docs.oasis-open.org/ubl/os-UBL-2.0/UBL-2.0.html#CODELISTS

All the best

Stephen Green



On 02/02/07, John Avery <j.avery@b...> wrote:
> 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
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l...
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>


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