W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2001

Choice of subelements by attribute value?

From: Bjoern Martin <mabj0011@fh-karlsruhe.de>
Date: Fri, 22 Jun 2001 16:40:37 +0200
To: xmlschema-dev@w3.org
Message-Id: <E15DS6v-000JZu-00@rz06.fh-karlsruhe.de>
Hi (me again ;)

I wondered if there is a possibility to restrict the appearance of 
certain subelements of an element by the value of an attribute.
Example:

<!-- valid: -->
<getdata type="http">
 <connection>...</connection>
</getdata>

<!-- valid: -->
<getdata type="https">
 <connection>...</connection>
</getdata>

<!-- invalid: -->
<getdata type="file">
 <connection>...</connection>
</getdata>

... because ...

<!-- valid: -->
<getdata type="file">
 <file>...</file>
</getdata>

I might be able to allow both subelements, but I actually want the 
necessary ones to be required. In that case, however, it doesn't make 
sense to require a <connection/> element for a "file" type data fetch, 
and vice versa.
I'd appreciate any hint on this one. Thx!

Bye,

Bjoern
Received on Friday, 22 June 2001 10:40:39 GMT

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