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.

Pour y voir plus clair dans la nebuleuse XML...
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 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC