W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2003

Deriving by restriction then extension

From: Graham Mann <gmann@adobe.com>
Date: Wed, 12 Mar 2003 19:30:37 +0000
Message-Id: <5.2.0.9.2.20030312191550.04ba9ce0@maileurope-nor.eur.adobe.com>
To: xmlschema-dev@w3.org

Hi,

I have a global element G based upon complexType B that contains (optionally in a sequence) ChildX

ChildX in turn (again optionally in a sequence) has many grand children GranChild1 ... GranChildN

There is another complexType D, derived by restriction from B that removes ChildX. This type is abstract.

Finally there is another complexType F, (one of several similar types) derived by extension from D.
This adds a sequence containing locally defined ChildX that has only GranChild1

The objective of this is to permit a document to have element G without using an xsi:type to permit all GranChild elements.
However an element using xsi:type="F" is restricted to only having GranChild1

Does the XML Schema spec, section 3.4.6: imply this is not permitted.
It does appear to work for Xerces J, Xerces C and for XMLSpy parsers.
        1.5. It must in principle be possible to derive the complex type definition
        in two steps, the first an extension and the second a restriction (possibly
        vacuous), from that type definition among its ancestors whose {base type
        definition} is the ·ur-type definition·. 
        NOTE: This requirement ensures that nothing removed by a restriction is
        subsequently added back by an extension. It is trivial to check if the
        extension in question is the only extension in its derivation, or if there
        are no restrictions bar the first from the ·ur-type definition·. 





Graham Mann
Adobe Systems Europe Ltd.
Received on Wednesday, 12 March 2003 14:32:32 GMT

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