- 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>
Suggestion: 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: <sequence> <element ref="a" /> <element ref="optionalelement" minOccurs="0" /> <!-- want to allow extensions here --> </sequence> 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: <sequence> <element ref="a" /> <element ref="optionalelement" minOccurs="0" /> <!-- want to allow extensions here --> <any minOccurs="0" maxOccurs="unbounded" /> </sequence> 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 think. Noah -------------------------------------- Noah Mendelsohn IBM Corporation One Rogers Street Cambridge, MA 02142 1-617-693-4036 -------------------------------------- "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: http://www.xfront.com/xml-schema-1-1/xml-schema-1-1.ppt Here is the updated tutorial + labs + examples: http://www.xfront.com/xml-schema-1-1/xml-schema-1-1.zip As always, please let me know if there is anything in the tutorial that is unclear or if you find a typo. /Roger
Received on Wednesday, 12 August 2009 18:41:24 UTC