W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2009

Re: [Update #2] XML Schema 1.1 Tutorial

From: <noah_mendelsohn@us.ibm.com>
Date: Wed, 12 Aug 2009 14:40:43 -0400
To: "Costello, Roger L." <costello@mitre.org>
Cc: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <OF67853572.1E03C7F8-ON85257610.0066088E-85257610.00669BF2@lotus.com>

I think the changes to support non-deterministic content models involving 
<any> is a big deal, and it would be good to highlight that in the 5 
minute intro along with the syntax changes to <any>

Use case is:

You have a content model like:

                <element ref="a" />
                <element ref="optionalelement" minOccurs="0" />
                <!-- want to allow extensions here -->

You want an optional wildcard at the end, and for whatever reason prefer 
not to use openContent (you like the explicit <any>, you want to control 
exactly where the extenion points are and some may not be at the end, 
etc.)  So, you want:

                <element ref="a" />
                <element ref="optionalelement" minOccurs="0" />
                <!-- want to allow extensions here -->
                <any minOccurs="0" maxOccurs="unbounded" />

In XSD 1.0 you could not do this, because an <optionalelement /> in the 
instance matched both the explicit particle and the wildcard.  In XSD 1.1, 
this does what you want.  I think that's worth pointing out.  Also, 
<openContent> works in the presence of optional elements, so there's no 
ambiguity problem with that in XSD 1.1 either.  Content will match the 
explicit element particle in preference to either an <any> or openContent. 
 I'm fairly sure that if there is an ambiguity between an <any> and 
<openContent> the tie goes to the explicit <any>.  In general, openContent 
only gets checked if you were otherwise about to fail validation.  I 


Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142

"Costello, Roger L." <costello@mitre.org>
Sent by: xmlschema-dev-request@w3.org
08/08/2009 01:27 PM
        To:     "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        [Update #2]  XML Schema 1.1 Tutorial

Hi Folks,

Here are the updates I made to the XML Schema 1.1 Tutorial:

    1. I received many excellent comments and 
       incorporated them.

    2. I created 20 lab exercises. I recommend 
       working the exercises as you read through 
       the tutorial.

Here is the updated tutorial:


Here is the updated tutorial + labs + examples:


As always, please let me know if there is anything in the tutorial that is 
unclear or if you find a typo. 

Received on Wednesday, 12 August 2009 18:41:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:16 UTC