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

Re: Choice: attribute or child element

From: Alessandro Vernet <avernet@scdi.org>
Date: Mon, 09 Dec 2002 11:28:51 -0800
Message-ID: <3DF4EEF3.5010803@scdi.org>
To: xmlschema-dev@w3.org

All,

Thank you all for your answers regarding the validation of documents 
of the form <a><b/></a> or <a c="..."/> (element "a" having a child 
element "b" or an attribute "c", but not both). It seems that this 
kind of document cannot be completely validated with a W3C Schema.

Does anyone know if this feature is considered for future versions of 
the specification? In my experience, this case is pretty frequent. The 
best known example is maybe XSLT where we can have either:

	<xsl:variable name="foo" select="'bar'"/>
or:
	<xsl:variable name="foo">bar</xsl:variable>

(The same is true for <xsl:with-param>). In fact, I have a very 
similar case with another XML application (XPL, used to define 
pipelines of XML processors in the OXF framework).

Ken, thank you for your suggestion regarding RNG. Actually, we already 
have an RNG schema, and I was trying to write an equivalent W3C schema 
as this format is better supported by XML editors.

Alex
Received on Monday, 9 December 2002 14:29:18 GMT

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