Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: restrictions on use of xs:all?

From: noah_mendelsohn@--.---.---
To: "DuCharme, Bob (LNG-CHO)" <bob.ducharme@----------.--->
Date: 8/30/2004 8:32:00 AM
Bob Ducharme writes:

>> Correct me if I'm wrong: because its use must be at the top level of a 
content model, we can define a content model like (a & b & c & d), but not 
(a, (b & c & d)), right? 

Right.  One way to think about it is that <xsd:all> provides for elements 
more or less the same rules one applies to attributes:  you can specify 
that you want the elements to occur exactly once (minOccurs="1" 
maxOccurs="1") or at most once (minOccurs="0" maxOccurs="1"), and in any 
order. 

A FAQ is why these limitations were made.  The short answer is:  because 
with these limitations, <xsd:all> can be implemented with much simpler 
techniques than a more generalized & as in your second example.  Indeed, 
the schema WG was initially reluctant to provide <xsd:all> at all, but 
agreed on the "exactly once/at most once at the top level" as a compromise 
that would be useful in many circumstances but tractable to implement.

Note that nothing in Schema can change the basic rules of XML Infoset, 
which is that element order is significant.  So, (A&B) validates:

<A/><B/>
<B/></A>

but it doesn't guarantee that the application can't learn anything useful 
from the order.  That's different from attributes, where the Infoset 
conveys no ordering information.  In practice, <xsd:all> is often used in 
situations where the application indeed does not care about the order of 
elements, but it can in principle be used anytime that all possible orders 
are legitimate.

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








"DuCharme, Bob (LNG-CHO)" <bob.ducharme@l...>
Sent by: xmlschema-dev-request@w...
08/30/2004 10:19 AM

 
        To:     "'xmlschema-dev@w...'" <xmlschema-dev@w...>
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        restrictions on use of xs:all?


I'm trying to get a better handle on exactly what is and what isn't 
allowed with xs:all. I used to think that elements that used it in their 
content model couldn't be nested inside of other elements, but I see now 
that this is wrong. 
 
Correct me if I'm wrong: because its use must be at the top level of a 
content model, we can define a content model like (a & b & c & d), but not 
(a, (b & c & d)), right? 
 
thanks,
 
Bob DuCharme





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent