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

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

From: Costello, Roger L. <costello@mitre.org>
Date: Wed, 3 Jun 2009 14:41:48 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB5003FD6BE6FF@IMCMBX3.MITRE.ORG>

Hi Folks,

I want to confirm my understanding.

Consider this <Book> element with open content:

<element name="Book">
    <complexType>
        <openContent mode="interleaved">
            <any />
        </openContent>
        <sequence>
            <element name="Title" type="string"/>
            <element name="Author">
                <complexType>
                    <sequence>
                        <element name="FirstName" type="string"/>
                        <element name="LastName" type="string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="Date" type="string"/>
            <element name="ISBN" type="string"/>
            <element name="Publisher" type="string"/>
        </sequence>
    </complexType>
</element>

Notice that the <Author> element has child elements, which are grandchildren of the <Book> element.

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?

/Roger
Received on Wednesday, 3 June 2009 18:42:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:12 GMT