Re: Equivalent ways to declare an element with string content and an attribute

 >Those are two equivalent ways of declaring an element with string 
content and an attribute.

Careful! You are using the word "equivalent" to mean that if an instance 
is valid under one schema then it is valid under the other, and vice 
versa. But schemas are not just about validation; a data binding product 
might generate different Java representations, and the validated 
instances will also be distinguishable in XSLT and XQuery.

 >Neat! For the second way, notice the empty <sequence> element. From my 
reading of section 3.4.2.3.3 (bullet 3 in the mapping summary box) it 
appears that anything but an empty <sequence> element is an invalid schema.

I've no idea how you came to this conclusion. An empty <choice> or <all> 
is perfectly valid; though an empty choice means what it says: there is 
nothing on the menu, there are no instances that satisfy this schema.

Michael Kay
Saxonica

Received on Tuesday, 18 December 2012 15:16:26 UTC