Re: Choice: attribute or child element

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 UTC