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

Re: [XML Schema 1.1] <openContent> applies only to the children, not the grandchildren ... correct?

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Wed, 3 Jun 2009 17:13:51 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-Id: <B6CD9797-D027-41B6-97C9-68C4A297566A@blackmesatech.com>
To: "Costello, Roger L." <costello@mitre.org>
Re: [XML Schema 1.1] <openContent> applies only to the children

On 3 Jun 2009, at 12:41 , Costello, Roger L. wrote:
>
> Extension elements can only be added before and after the *children*  
> of Book. Extension elements cannot be added around the  
> *grandchildren* of Book. Thus, extension elements cannot be added  
> before or after <FirstName> and <LastName>.
>
> Is this correct?

It depends on whether the enclosing schema element has
a 'defaultOpenContent' child or not.

If it does not (which is what I assume you had in mind),
then your description will be correct.

But just for completeness, I will add a pedantic note:

If the schema element does have a defaultOpenContent child,
then the complex type for Author (i.e. the one whose SCD is / 
schemaElement::Book/type::*/schemaElement::Author/type::*)
also has open content and thus allows extension elements
among the grandchildren of Book.

Just as the content model for any complex type describes
its children, not all of its descendants, so similarly the
open content for any complex type determines whether
additional elements are allowed among the children and
does not constrain the grandchildren to do it the same way.
For any type T declared in a schema element D, you can
know whether instances of T accept open content by looking
at the declaration for T and the enclosing schema element
D -- you do not need to look at every type which could
conceivably be assigned to an ancestor of an element
typed T.

I hope this helps.

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************
Received on Wednesday, 3 June 2009 23:14:27 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.