OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Can XML Schemas do this?

[ Lists Home | Date Index | Thread Index ]

Eric van der Vlist scripsit:

> Together with confusing the usage of elements and attributes, another
> bad habit taken during our few years of XML experience is the assumption
> that schemas should always enforce a fixed order between children
> elements or in other words that relative order between sub elements
> always matters. 

I think this conflates two issues.  It's analogous to the bilingualism
paradox:  in countries where most people are monolingual (but not all
speaking the same language), it is common for the government to be
officially bilingual (e.g. Belgium, Canada); in countries where most
people are bilingual or multilingual, it is common for the government
to be monolingual (e.g. most African countries).

Similarly, if the order of child elements is meaningful, then the schema
should allow the children to appear in any order; if the order is not
meaningful, then there is no reason to allow multiple orders (other than
backward compatibility).  If multiple orders are allowed nonetheless,
people may easily come to believe that order has significance and use
it as if it did.

> [W]e shouldn't bother users and applications with the unecessary
> constraint of enforcing [ordering]. 

But that shifts the burden from validation to processing.  If we don't
enforce order at validation time, then we must have a more general
processing loop that can accept any element at any time.  If we do
enforce order, then the processing stage can be simpler:  accept a "foo"
if there is one, accept a "bar", accept a "baz", etc. etc.  In streaming
applications, a well-chosen order of children (viz. no forward references)
can make processing much more straightforward.

> With Relax NG, defining content models where the relative order between
> children elements is not significant is not only almost as simple as
> defining content models where it is significant (it's just a matter of
> adding "interleave" elements) but it is also more extensible since these
> content models can easily be extended through pattern combinations by
> "interleave". 

"It can be done" is no argument for "it should be done".

"No, John.  I want formats that are actually       John Cowan
useful, rather than over-featured megaliths that   http://www.ccil.org/~cowan
address all questions by piling on ridiculous      http://www.reutershealth.com
internal links in forms which are hideously        jcowan@reutershealth.com
over-complex." --Simon St. Laurent on xml-dev


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS