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

Re: Choice of subelements by attribute value?

From: Jeff Rafter <jeffrafter@definedweb.com>
Date: Fri, 22 Jun 2001 07:49:43 -0700
Message-ID: <00fb01c0fb2a$938e2b20$f181fea9@lazarus>
To: <bjoern.martin@gmx.net>
Cc: <xmlschema-dev@w3.org>
> I wondered if there is a possibility to restrict the appearance of
> certain subelements of an element by the value of an attribute.
> Example:

No, not in XML Schemas 1.0.  This is called a co-constraint and won't be
available until later versions.  Currently the best you can do is to allow
all of the possible elements and create an application rule in some other
manner-- or use a different schema language.  The best way is to mix XML
Schema and Schematron.  There is a great example of how to do this at:

http://www.xfront.com/ExtendingSchemas.html

Good Luck,
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting
Received on Friday, 22 June 2001 10:50:03 GMT

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