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:
- Full XPath is a problem for implementors without access to
pre-existing complete XPath implementations
- Streaming processors have problems: in the worst case implementing
Identity Constraints effectively converts them into full-image-in-memory processors
2.
Options for simplification short of removal
Three main possibilities can be identified:
- Restrict the inventory of XPath axes, predicates and functions which
can be employed to reduce implementation burden;
- Further restrict the inventory to render streaming processing much simpler.
- 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:
-
Simplification: http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2000Mar/0047
-
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