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

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 UTC