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 ]

Hi John,

On Tue, 2003-01-21 at 16:29, John Cowan wrote:

> If multiple orders are allowed nonetheless,
> people may easily come to believe that order has significance and use
> it as if it did.

That's just a matter of documentation!
> > [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.

I think that the additional complexity is overstated. SAX is my favorite
XML API and I find it much more robust (and only slightly more complex)
to never rely on the relative order of children elements. In the
frequent case where I want to build an object out of an element, I use
to create the object and assign the properties given as attributes on a
start element, assign properties independently for each child element
and do final tests and operations on end element. I really don't see the
additional complexity...

> > 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".

Out of context, no (sorry for that). This snippet came from a section
giving hints to write extensible Relax NG schemas and if this is
important for you, I think that using "interleave" is really a thing to

Freelance consulting and training.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema


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

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