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

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>

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 / 
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 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:51 UTC