[
Lists Home |
Date Index |
Thread Index
]
- From: Robin LaFontaine <robin@monsell.co.uk>
- To: Lars Marius Garshol <larsga@garshol.priv.no>, glen.albert@autodesk.com,xml-dev@xml.org
- Date: Fri, 14 Jul 2000 15:56:48 +0100
Lars,
Further discussions with Henry Thompson indicate that it is *not*
possible to do this in XML Schema. See below for answer to your other
question.
Henry says:
>Resent-Date: Wed, 12 Jul 2000 11:43:55 -0400 (EDT)
>To: Robin LaFontaine <robin@monsell.co.uk>
>Cc: xmlschema-dev@w3.org
>From: ht@cogsci.ed.ac.uk (Henry S. Thompson)
>Date: 12 Jul 2000 16:43:48 +0100
>Lines: 52
>User-Agent: Gnus/5.0805 (Gnus v5.8.5) XEmacs/21.2(beta13) (Demeter)
>Subject: Re: XML Schema: element ordering
>Resent-From: xmlschema-dev@w3.org
>X-Mailing-List: <xmlschema-dev@w3.org> archive/latest/119
>X-Loop: xmlschema-dev@w3.org
>Sender: xmlschema-dev-request@w3.org
>Resent-Sender: xmlschema-dev-request@w3.org
>
>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/
At 3:52 pm +0200 14/7/00, Lars Marius Garshol wrote:
>* Robin LaFontaine
>|
>| A related question: is it possible in XML Schema to distinguish
>| between the case where the order of the element instances is
>| important (significant) and where it is not?
>
>Using sequence and all as described in
>
><URL: http://www.w3.org/TR/xmlschema-1/#Model_Group_details >
>
>should allow this.
'all' is a special case of a group of items each of which can occur
just once but in any order - that is not the same as repeated items
that can occur in any order. Sequence is by definition ordered.
>
>| For example, clearly for a list of points denoting a shape, the
>| order of the points is important. But for a set of points
>| representing possible target positions, the order is not important.
>
>Why do you think it is important to be able to distinguish between
>these cases in the schema? Is it for the sake of clarity or is it for
>other reasons?
The reason is that in order to compare two data sets in XML it is
essential to know if the order is significant or not. Typically in
documents it is, but in data it is often not. Just consider comparing
two files of names and addresses: if these are in a different order
it does not matter.
>
>--Lars M.
Robin
-- -----------------------------------------------------------------
Robin La Fontaine, Monsell EDM Ltd
(R&D Project Management, Engineering Data Exchange using XML, EDIF)
Tel: +44 1684 592 144 Fax: +44 1684 594 504 or +44 870 054 2811
Email: robin@monsell.co.uk http://www.monsell.co.uk
|