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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Should we care about elements order ?

[ Lists Home | Date Index | Thread Index ]
  • From: Eric van der Vlist <vdv@dyomedea.com>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 20 Oct 2000 17:20:29 +0200

I hope the list won't mind a technical post :):) and I'll try to keep it
as philosophical as possible...

I'd like to start a discussion (if possible in this order ;=) ) about
several related issues:

1) Should we always pay attention to the relative order of the elements
within XML documents ?

2) Can we impose the order of elements belonging to different namespaces
without seriously impacting the overall extensibility ?

3) What do schema based validation tools have to say about this ?

4) Can we find a solution amongst rules based validation tools ?

_________________________
If it's OK, let's start with #1...

1) Should we always pay attention to the relative order of the elements
within XML documents ?

If I am asking the question it's because, unless I have a good reason, I
don't pay too much attention to the relative order of elements having a
different type.

I must say that I am using XML mainly for lightweight applications but I
usually don't care about writing a title before a description or a vice
versa.

I think it would be a bad practice for applications to rely on the order
of elements of different types within a document anyway and when I need
to display a title before a description I prefer to specify it
explicitly in order to keep a good decoupling between the data and its
presentation.

Flame me if I have missed something, but except for the fact that it
makes it almost impossible to use any schema based validation tool -a
point that we'll see later on- I have never found any drawback doing so.

I don't think I am an exception. I have been working with RSS feeds and
I have been surprised to see the number of feeds where link is before
title or image after the items or whatever.

Is it really important and should we continue to flame the authors and
increase their feeling that XML is rigid, difficult to use and not user
friendly ?

_________________________
2) Can we impose the order of elements belonging to different namespaces
without seriously impacting the overall extensibility ?

Let's now extend this problem to extensible modular vocabularies.

Imagine a vocabulary defining a core and allowing different modules
-using different namespaces- to add their own elements.

Is there a good reason to restrict the relative order in which the
different modules will insert their elements into the core ?

If yes, isn't seriously impacting the extensibility of this vocabulary
and imposing a central registry system ?

Otherwise, how can you impose that 

<core:foo>
	<mod1:bar/>
	<mod2:bar/>
</core:foo>

is valid while

<core:foo>
	<mod2:bar/>
	<mod1:bar/>
</core:foo>

is invalid ?
_________________________
3) What do schema based validation tools have to say about this ?

None of the schema based validation tools I know (DTD, XML Schema and
Relax) seem able to do a fine job with unordered elements.

Like it's the case with a DTD, XML Schema and Relax can handle unordered
elements at the price of giving up almost any control on their
occurrences.

The issue has been submitted to the XML Schema WG as LC-16 and LC-132
and the response (Martin Gudgin, [1]) has been recently again to decline
it.

The reasons for this decision are a questioning of the legitimacy of the
request (Michael Sperberg-McQueen, [2]) :

> I have no trouble imagining users who say that
> is what they want; I am having trouble imagining a case where they
> are right.

This argument has been severely contested (James Clark, [3]), though:

> It is a design goal of many XML vocabularies to allow convenient
> authoring with a regular editor, and not to require a specialized XML
> editor.  When there are many different child element types, requiring a
> particular order is a significant inconvenience for authoring without an
> XML editor: a user has either to remember the order or continually refer
> to documentation.  Schemas should not just be for XML vocabularies that
> will be created with XML authoring support.

And the main motivation appears to be to facilitate the work of the
implementations (Henry S. Thompson, [4]):

> As it stands (wrt <all>) there is nothing in the XML Schema language
> whcih precludes implementing content models with absolutely standard
> FSM technology.  The change you propose would I believe break that.  I 
> _really_ don't want to do that, for a very modest gain in expressive
> power.

[note: FSM= Final States Machine] 

I have great respect for the Schema implementors, but I wonder if the
validation tools should impact the design (I would have preferred to see
data modeling impacting the validation tools;) ).
_________________________
4) Can we find a solution amongst rules based validation tools ?

A rule based validation tool such as Schematron seems a better fit here
since allowing unordered elements means writing less (or less stringent)
rules.

The problem I see with these tools is that they are pushing a heavy load
on the developers who need to make sure they have written all the rules
to fully validate a data model.

So far, it's probably the only solution to validate vocabularies with
unordered elements, though...

To end up shedding some hope over a rather sad story, I wonder if
someone has already explored the possibilities to derive rules from a
schema model, bringing a bridge between these 2 technologies ?

Thanks to have read so far !

Eric

[1]
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000OctDec/0111.html 
[2]
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000OctDec/0145.html
[3]
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000OctDec/0203.html
-- 
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
------------------------------------------------------------------------




 

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

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