W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2016

Re: a small document about XML Schema <sequence> vs <all> constructs

From: Michael Kay <mike@saxonica.com>
Date: Wed, 27 Jul 2016 15:07:34 +0100
Cc: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-Id: <8CCCA65E-EFF5-4723-8543-DD51ADA0FABF@saxonica.com>
To: Mukul Gandhi <gandhi.mukul@gmail.com>
Intesting that that's the opposite of what I suggested, but of course it makes sense. If you have

<created/>
<modified/>
<checked/>
<modified/>
<copied/>
<combobulated/>

representing a sequence of events, then they can occur in any order and the order is significant. So use ANY.

I was thinking more of the case where the elements represent separate properties with no ordering:

<height/>
<width/>
<wealth/>
<baldness/>

Both ANY and SEQUENCE work there, and it seems to be a matter of taste.

Michael Kay
Saxonica


> On 27 Jul 2016, at 12:52, Mukul Gandhi <gandhi.mukul@gmail.com> wrote:
> 
> As usual Mike, your views are nice to know. My replies are inline please.
> 
> On 27 July 2016 at 13:07, Michael Kay <mike@saxonica.com <mailto:mike@saxonica.com>> wrote:
> There are some cases where there clearly should be an order: in a table, the head comes before the body. (But why? Only because we are used to thinking of it that way. We could argue that this is purely a conventional way of presenting the table, and nothing to do with its semantics.)
> 
> I agree.
>   
> So from a usability perspective, it's a tough call, but one could probably say that imposing order makes things a little harder for authors and a little easier for readers.
> 
> I agree. This is a good point.
>  
> Note also that the human authors of this document have tended to be very consistent in the way attributes are ordered, even though the schema imposes no constraints. When, after a transformation, the dependency element reads  <dependency value="XQ31+" type="spec"/>, that really upsets the human reader.
> 
> This is a good point too. I think, as you said the schema imposes no constraints on attribute ordering (it cannot, because XML itself says that attribute ordering is not predictable). 
> 
>  
> In fact, that's why I added a serialization property to Saxon to allow you to control attribute order on output.
> 
> I think, this is something nice you've done with Saxon's XSLT processor.
>  
> 
> If you're dealing with a vocabulary like GML that is never authored or read by humans, then these usability factors play no role, and it's even harder to find any good reason for deciding between sequence and all.
> 
> Thanks for telling about this, and I agree.
>  
> There is certainly a good argument for saying that if the ordering carries no semantic information, there is no case for the schema to impose an order.
> 
> Found it little harder to grasp meaning of this. But it is correct.
>  
> 
> 
> -- 
> Regards,
> Mukul Gandhi


Received on Wednesday, 27 July 2016 14:08:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:16:11 UTC