[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: [Updated] XML Schema 1.1 Tutorial

From: Michael Kay <mike@saxonica.com>
Date: Thu, 30 Jul 2009 14:10:31 +0100
To: "'Costello, Roger L.'" <costello@mitre.org>, <xmlschema-dev@w3.org>
Message-ID: <2503678C63094851AD5FCA899F1028C0@Sealion>
RE: [Updated] XML Schema 1.1 Tutorial
> 108 shows an xsd:alternative element with an inline simple type 
> definition.  This is not strictly speaking illegal or 
> impossible, but since the element in question is being handled with 
> conditional type 
> assignment it will typically have attributes, and if it has any 
> attributes, it won't be legal against any simple type.  So a simple 
> type will be a possible alternative type only when the tests are 
> rather unusual.  The use of a simple type is most plausible if all the 
> tests relate to some inherited attribute.
> 

Another plausible scenario is for one alternative to be a complex type with
simple content (where an attribute exists) and for another alternative to be
a simple type (where the attribute doesn't exist). I'm not quite sure if
that works, without checking the detailed rules, but it's a reasonable
scenario. It could arise where version 1 of a schema had
<weight>200g</weight>, and version 2 retains that format for backwards
compatibility, but also allows <weight units="g">200</weight>

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
Received on Thursday, 30 July 2009 13:11:12 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.