Restricting XML Schema Identity Constraints: Two Possibilities

Henry S. Thompson
18 January 2001

1.   Background

CR feedback has identified Identity Constraints as an aspect of XML Schema which has caused some concern. Two particular classes of observations have been made:

2.   Options for simplification short of removal

Three main possibilities can be identified:

  1. Restrict the inventory of XPath axes, predicates and functions which can be employed to reduce implementation burden;
  2. Further restrict the inventory to render streaming processing much simpler.
  3. In addition remove multi-part keys to render streaming processing of identity constraints essentially the same as processing ID/IDREF.

3.   Concrete proposals

The first two options above are described in concrete proposals:

  1. Simplification: http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2000Mar/0047
  2. Further simplification: http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000OctDec/0520

4.   Examples

Examples of paths allowed under different options

Currently
foo @bar foo/baz foo/baz/@bar foo[@baz] /foo foo[baz] //foo .//foo ancestor::state//foo preceding-sibling::foo .//foo[@bar/2=self::*/@baz+13]
Simplification
foo @bar foo/baz foo/baz/@bar foo[@baz] /foo foo[baz] //foo .//foo ancestor::state//foo
Further simplification
foo @bar foo/baz foo/baz/@bar foo[@baz] /foo