[xsde-users] Will XSD/E support XML Schema 1.1 new features?

Boris Kolpackov boris at codesynthesis.com
Mon Mar 22 12:23:27 EDT 2010


Hi Kjell,

Kjell Svensson <iftroja at live.com> writes:

> However when I have read about how to version xml schemas I get 
> the impression that 1.1 will have better support, e.g. by using 
> openContent.

Yes, that's probably correct. Note, however, that 1.1 still has
some way to go before it becomes mainstream. The best indication
of that is the fact that there is only one XML Schema processor
that support this version, and, in fact, only parts of it. So 
unless your schemas are for the internal use only, it won't be 
wise to reply on the features found in 1.1 since others may not
have a processor for their platform/loanguage/application that 
supports this version.


> Our requirement is that the xml shall be possible to extend.
> Defined elements cannot be removed. And we shall follow the 
> rule "must ignore any attribute or element that we do not 
> recognize"

This can be achieved with wildcards (xsd:any and xsd:anyAttribute)
in 1.0, though perhaps not as elegantly as in 1.1. The basic idea
boils down to this:

<complexType name="person">
  <sequence>
    <element name="first-name" type="string"/>
    <element name="last-name" type="string"/>
    <any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded" />
  </sequence>
  <anyAttribute namespace="##any" processContents="skip"/>
</complexType>

There could be some difficulties with particle attribution (which were
also addressed in 1.1) if you have sequences of elements at the end
but overall it can be made to work (in XSD/e you can disable UPA
checking in the compiler and the generated code will do the right
thing).

Boris



More information about the xsde-users mailing list