W3CArchitecture Domain XML

XML Schema Versioning namespace
http://www.w3.org/2007/XMLSchema-versioning

27 August 2007

Table of contents

  1. Introduction
  2. Related resources
  3. Normative References

The URI http://www.w3.org/2007/XMLSchema-versioning identifies a namespace used for two attributes in the XSDL 1.1 specification, namely minVersion and maxVefrsion.

This document describes the XML Schema Versioning namespace and provides links to related resources, using Resource Directory Description Language.

How it workds

The basic idea of the attributes is simple: before an XSDL processor does anything else with a schema document, it performs a pre-processing step that executes a simple algorithm for conditional inclusion and exclusion of the elements in the document.

  1. The processor supports a particular version of XSDL, e.g. 1.1 (or possibly, in the future, 1.2, 2.0, etc.). For purposes of the algorithm, this version number is treated as a value of type xs:decimal. Call this number V (for ‘version number’).
  2. Each element in the input document is examined to see if it carries either of the attributes minVersion or maxVersion in the namespace http://www.w3.org/2007/XMLSchema-versioning.
  3. If it does, then the attributes are treated as having decimal values, which are compared to V. If V is less than minVersion, or greater than maxVersion, then the element is excluded from the schema document, including all its descendants, before further processing is done.

Schema authors can use this to provide alternative formulations of some constructs, using idioms like the following:

<schema ... 
   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">

  <complexType name="T" vc:maxVersion="1.1">
    ... definition for version 1.0 and 1.1 processors  ...
  </complexType>
  <complexType name="T" vc:maxVersion="1.2">
    ...  definition for 1.2 and later processors  ... 
  </complexType>

</schema>

In this way, schemas can use constructs from newer versions of XML Schema even while the set of actually deployed schema processors is a mixture of those which support the new constructs and those which do not support them.

For a fuller normative description, see section 4.2.1 Conditional Inclusion of XSDL 1.1 Part 1: Structures.

This namespace and XSDL 1.0 processors

XSDL 1.0 does not require schema processors to support this namespace or the minVersion and maxVersion attributes. However, the spec says explicitly that the infoset used as a schema document does not necessarily come directly from parsing an XML document but may be a ‘synthetic infoset’, the output of some other process.

It is thus quite clear that a conforming XSDL 1.0 processor can implement this mechanism, to allow schema authors to write schema documents usable both with XSDL 1.0 processors and with 1.1 processors.

The XML Schema Working Group or others may publish a note on this topic; at the moment, however, no such note has been published.

Stability of this namespace

Users of the namespace documented here should be aware, as a matter of namespace policy, that more names in this namespace may be given definitions in future versions of the XSDL specification, or in other specifications. You should not assume that the namespace has no meaningful names other than those defined at this point.

Related Resources

Schema for this namespace

An XML Schema schema document is available, which provides XSDL declarations for the two attributes now defined in this namespae.

Normative References

  1. W3C XML Schema Definition Language (XSDL) 1.1 Part 1: Structures
  2. XML Schema Part 1: Structures (Version 1.0)