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

XML Schema : Validating contents of one tag with another

From: <kraj@infoprosolutions.com>
Date: Thu, 17 Jan 2002 08:27:10 -0500 (EST)
Message-ID: <3C46D10E.80628086@infoprosolutions.com>
To: xmlschema-dev@w3.org
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 Thursday, 17 January 2002 09:00:36 GMT

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