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] Questions on XML Schema "all" and RELAX NG "interleave"

[ Lists Home | Date Index | Thread Index ]

> -----Original Message-----
> From: ht@inf.ed.ac.uk [mailto:ht@inf.ed.ac.uk] On Behalf Of 
> Henry S. Thompson
> Sent: Sunday, January 05, 2003 23:05
> To: Alessandro Triglia
> Cc: [XML-DEV]
> Subject: Re: [xml-dev] Questions on XML Schema "all" and 
> RELAX NG "interleave"
> "Alessandro Triglia" <sandro@mclink.it> writes:
> > One concrete question I might ask is, If I have an "all" group of 3 
> > elements in a schema, and an instance contains the 3 
> elements in some 
> > order (any order being valid), how much does it matter if a tool 
> > re-orders the elements on reception, and presents them to 
> the user in a
> > fixed order?   Could I justify such a behavior of the tool by saying
> > that the order in an "all" group is not important?   What are the
> > chances that the order *is* important and the user 
> absolutely wants it 
> > to be preserved?
> The chances ought to be high if the <all> group is being used 
> responsibly (which it often isn't, in my experience).  Let's 
> approach this from the other side -- if an element is 
> declared to contain a, then b, then c as children, then the 
> relative order of a, b and c in an instance carries no 
> semantics.  From this Occam suggests that in cases where 
> there is no intention to convey different semantics with 
> different order among siblings, a sequence should always be 
> used, to avoid potential misunderstanding.  _If_ this 
> argument is persuasive, then you should _only_ use <all> when 
> order _does_ matter, in which case re-arrangement changes the 
> meaning of the document and should be avoided.
> > Another possible question is, How does a user (either sending or
> > receiving) benefit, in general, in RELAX NG, from the ability to 
> > interleave, say, elements A (multiple), B (multiple), and C 
> (multiple) 
> > of an "interleave", as opposed to sending all As, then all 
> Bs, then all
> > Cs?  Or possibly all Cs, then all Bs, then all As?   Why is 
> "interleave"
> > more useful than "all", and why is "all" more useful than 
> "sequence"? 
> > What do these things enable me to do, which a mere "sequence" does 
> > not? Why do I need the extra flexibility?
> As per the above, if you need to reflect some underlying 
> ordering, then you need a *ed choice or an all.  Suppose for 
> instance you have a queue of transactions to be processed, 
> say some deposits and some withdrawals.  If you wish their 
> order in the queue to be represented by their order in the 
> document, you can't simply put all the deposits first 
> followed by all the withdrawals.
> Hope this helps

Many thanks, it surely helps.  

I would like to hear other people's views as well.


> ht
> -- 
>   Henry S. Thompson, HCRC Language Technology Group, 
> University of Edinburgh
>           W3C Fellow 1999--2002, part-time member of W3C Team
>      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 
> 131 650-4440
> 	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
> 		     URL: http://www.ltg.ed.ac.uk/~ht/
>  [mail really from me _always_ has this .sig -- mail without 
> it is forged spam]


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

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