XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Look-up tables in XML Schema

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@ballarat.edu.au> 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@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS