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

Re: Choice of subelements by attribute value?

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Fri, 22 Jun 2001 17:17:15 +0200
Message-ID: <3B33617B.1EB04335@dyomedea.com>
To: bjoern.martin@gmx.net
Cc: xmlschema-dev@w3.org
Bjoern Martin wrote:
> 
> 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.

No, W3C XML Schema is very strict on avoiding any possible ambiguity and
you would have to use different element names to make this possible
(getHTTPdata, getHTTPSdata, getFILEdata) with W3C XML Schema alone.

You can also add extra tests in addition to W3C XML Schema as Jeff
Rafter pointed out, but it's actually (IMHO) one of the key differences
between W3C XML Schema and alternatives such as RELAX NG where these
constructs are trivial to describe.

Eric
-- 
Pour y voir plus clair dans la nebuleuse XML...
                                          http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
Received on Friday, 22 June 2001 11:17:22 GMT

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