This is a part of my xml schema
One-and-half year after this question and the accepted answer were posted, XSD 1.1 was published. In this version it is possible to specify what the OP asked for because a number of restriction on xs:all
were lifted. One of them is that it is now possible to extend an xs:all
.
Using XSD 1.1 you can specify the following:
This defines the following types:
Person
: an abstract type with optional unordered name
and phone
elements;Friend
: extends Person
adding an optional address
element to the list of unordered elements;Coworker
: extends Coworker
adding an optional office
element to the list of unordered elements.Note that this solution does not work for every XML processor: even though 8 years have passed since the publication of XSD 1.1, a lot of processors still only support XSD 1.0.