W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

Re: LC-16 ( LC-132 ): Allow arbitrary order with occurrence > 1

From: Ronald Bourret <rpbourret@rpbourret.com>
Date: Fri, 20 Oct 2000 12:17:26 -0700
Message-ID: <39F09A46.D4BC6638@rpbourret.com>
To: www-xml-schema-comments@w3.org
C. M. Sperberg-McQueen wrote:

> Any formalism for defining languages is better at some things than
> at others; adding ad hoc rules for what are thought to be special cases
> is not usually thought to be the way to improve a system.  Is there a
> reason to think that counting occurrencs in the way you suggest will be
> an exception to the general rule?  Is there a general rule that suggests
> a reason why we ought to expect this to be a common construct?  Could
> you give a concrete use case for allowing an arbitrary sequence of
> a, b, c, and d elements where (a) the sequence of the elements is
> significant, (b) each element must occur some distinct number of times
> (a one to four times, b exactly once, c ten to thirty times, and d
> exactly three times)?  I have no trouble imagining users who say that
> is what they want; I am having trouble imagining a case where they
> are right.

I suspect that the general case is more likely to be 0, 1, or arbitrary,
rather than exactly n. For example, consider a sales order serialized as
XML. This has a SONumber child, a Customer child, a Date child, and an
arbitrary number of LineItem children. It doesn't matter what order
these children appear in.

In general, any time you use XML to serialize objects (such as Java) or
data (such as from a database), sibling order is unlikely to be
unimportant. And why should it be? There is no concept of order among
properties in an object or columns in a relational database.

As to how common this is, there is a growing body of tools that use XML
to serialize objects or transfer data between XML and databases.
Examples include object servers (Castor, Object Translator), various
data transfer middleware (ADO, ASP2XML, Beanstalk, DB2XML,
DBIx::XML_RDB, InterAccess, ODBC Socket Server, XML-DBMS, XML-JDBC
Bridge, XMLShark, XML SQL Utiilty for Java), all XML-enabled relational
databases (Oracle, SQL Server, DB2, Informix), and XML servers such as
Bluestone and eXcelon.

I haven't looked closely enough at Bluestone and eXcelon to know if they
can store order information in the database. Of the object servers,
middleware, and relational databases, only XML-DBMS and (I think) DB2
appear to be capable of storing order information in the database. As to
the others, whether they can even specify the order of sibling elements
depends on how the mapping between XML document and object/database is
done. If it is based on an SQL statement, then specification is
presumably possible by listing columns in a certain order in the select
list. If it is through a more generic map file, order generally doesn't
appear to be specifiable.

The important thing here is that these products, for the most part,
don't seem to consider sibling order to be important, but most are
presumably interested in all groups + occurrence values as a way to
validate incoming documents. I have no idea how hard these are to
implement, but I don't think you can call them unimportant.

-- 
Ronald Bourret
Programming, Writing, and Training
XML, Databases, and Schemas
http://www.rpbourret.com
Received on Friday, 20 October 2000 15:20:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:48 GMT