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

RE: all, xs:sequence, and xs:choice

From: Michael Kay <mike@saxonica.com>
Date: Fri, 13 May 2005 09:50:34 +0100
To: "'Xiaofeng Wang'" <wangx49931@yahoo.com>, <xmlschema-dev@w3.org>
Message-ID: <E1DWVsZ-0007DT-AZ@bart.w3.org>
xs choice

> Hi All,
> 
> I can define a complexType A with a set of elements
> using xs:all, xs:sequence, or xs:choice. I understand
> the difference between them. What confuses me is that
> if I want to define a new complexType B which extends
> complexType A using xs:extension, will xs:all,
> xs:sequence, and xs:choice have different impact on
> the extension?
> 

If the content model of A is MA, then when you define a new type B as an
extension of A, giving it a content model of MB, the combined type is

sequence (MA, MB)

So if A was a choice of A1 or A2, and B is a choice of B1 or B2, the
extended type is

sequence (choice(A1, A2), choice(B1, B2))

This doesn't work with xs:all, which (IIRC) doesn't allow extension.

Michael Kay
http://www.saxonica.com/
Received on Friday, 13 May 2005 08:50:45 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.