W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2000

Re: XML Schema: element ordering

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 12 Jul 2000 16:43:48 +0100
To: Robin LaFontaine <robin@monsell.co.uk>
Cc: xmlschema-dev@w3.org
Message-ID: <f5b8zv773rf.fsf@cogsci.ed.ac.uk>
Robin LaFontaine <robin@monsell.co.uk> writes:

> There is a basic requirement for most data structures to distinguish
> between a 'list', which is ordered, and a 'set' which is not.
> 
> 
> I cannot see how, in XML Schema, to make this distinction.
> 
> For example:
> 
>     <element name="CoordGeom">
>             <complexType>
>               <choice minOccurs="0" maxOccurs="unbounded">
>                   <element ref="Line"/>
>                   <element ref="Curve"/>
>                   <element ref="Spiral"/>
>               </choice>
>             </complexType>
>     </element>
> 
> How can I indicate if the sequence of element instances within the
> choice is significant ('list') or not ('set')?
> 
> 
> I have not been able to determine the answer to this question from
> reading the spec, except that by omission I think the answer is 'you
> cannot do this in XML Schema'!

You cannot _say_ this in XML Schema.  You can do it just fine, but
it's down to applications to know when order is significant in ordered 
elements and when it isn't.

One way to think about this is: On the simple type side, we define
both type-specific lexical and value spaces.  On the complex type
side, we define type-specific lexical spaces, but only a generic value 
space, based on the XML Infoset model.  The children of element
information items are ordered in that model:  whether that order has
application significance or not is not expressable at the infoset
level.

Given the difficulties of specifying a universal application data
model for complex types, the WG decided not to step even a little bit
down on to the slippery slope that allowing people to say 'list, set,
bag, poset, ...' would represent.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Wednesday, 12 July 2000 11:43:52 GMT

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