W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2008

Re: Database schema from standards xsd

From: <noah_mendelsohn@us.ibm.com>
Date: Thu, 3 Apr 2008 18:29:08 -0400
To: Boris Kolpackov <boris@codesynthesis.com>
Cc: "'Mansour Al Akeel'" <mansour.alakeel@gmail.com>, Michael Kay <mike@saxonica.com>, xmlschema-dev@w3.org
Message-ID: <OFF6E256DA.AB139097-ON85257420.007AE847-85257420.007B594B@lotus.com>

Boris Kolpackov writes:

> There are ways to specify in XML Schema whether elements should appear
> in a particular order or not (xs:sequence vs xs:all).

I'm afraid that's not correct.  Specifying "the sequence A, B, C" means 
that only the elements A, B and C are allowed, and only in that order. 
Specifying "all of A, B, C" does NOT necessarily mean order does not 
matter.  It merely means that all of the following are acceptable 
instances:

A B C
A C B
B A C
B C A
C A B
C B A

It is perfectly reasonable for an application to assign a different 
meaning to A B C than to C B A.  In such a case, a database mapping that 
failed to retain the order would result in bugs.  The schema workgroup at 
one point considered a request from the XML Query workgroup for a standard 
annotation that would indicate whether order was significant, but as we 
got closer to refining the specification, the Query workgroup indicated 
that their interest had diminished and the feature was dropped.

In general, the order of XML elements is significant regardless of what 
the schema says.  Sometimes, as with the sequence above, the correct order 
can be inferred from the schema, and so in principle need not be 
separately tracked on a per-instance basis.  Ironically, it is in the 
"all" case that the database is likely to have to track the order per 
instance.  Also, as Mike says, there are many obvious cases involving 
repeating elements in which order matters.

Noah

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------
Received on Thursday, 3 April 2008 22:29:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:46 UTC