W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

Re: XML Schema : Validating contents of one tag with another

From: Eddie Robertsson <erobertsson@allette.com.au>
Date: Mon, 11 Feb 2002 00:40:48 -0500 (EST)
Message-ID: <3C675BC2.D7187A90@allette.com.au>
To: Bob Schloss <rschloss@us.ibm.com>
CC: kraj@infoprosolutions.com, xmlschema-dev@w3.org
> This is known as co-occurance constraints.
> Version 1.0 of the W3C XML Schema Language does not support
> co-occurance constraints.
>
> I would like to encourage everyone to look at the XML Schema FAQ.
> http://www.schemavalid.com/faq/xml-schema.html
>
> (I think the W3C XML Schema working group should have a link
> to this resource at http://www.w3.org/XML/Schema, but I do not think
> they do.)
>
> I believe the answer to your question was included in this entry:
> http://www.schemavalid.com/faq/xml-schema.html#c3

I'm currently working on a paper that will explain the details of embedding
Schematron rules in the <xs:appinfo> element in a W3C XML Schema. I've put
up a draft at [1] which contains some background, introduction to
Schematron, examples of embedded Schematron rules and how the validation
process works. The draft also contains a link to a zip file with all the
examples used so you can try it out yourself.

All comments are welcome.

Cheers,
/Eddie

[1] http://www.topologi.com/public/Schtrn_XSD/Paper.html

> Regards,
> Bob Schloss
> IBM Research
>
> kraj@infoprosolutions.com@w3.org on 01/17/2002 08:27:10 AM
>
> Sent by:    xmlschema-dev-request@w3.org
>
> To:    xmlschema-dev@w3.org
> cc:
> Subject:    XML Schema : Validating contents of one tag with another
>
> Hi,
>
> How do I write a contraint in XML Schema document that validates content
> of a tag based on content of another. e.g. below : The AIRBILL can have
> a value only when CARR_CODE has a value otherwise not.
> Here e.g. 1 is valid but 2 is not.
> 1.
> <CARR_CODE>XYZ</CARR_CODE>
> <AIRBILL>123</AIRBILL>
>
> 2.
> <CARR_CODE></CARR_CODE>
> <AIRBILL>12345</AIRBILL>
>
> How do I constraint this dependency while writing the XML Schema
> document ?
> Can anybody help ?
>
> Thanks,
> KRISHNA RAJ
> kraj@infoprosolutions.com
Received on Monday, 11 February 2002 03:25:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT