W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2003

Re: Constraints in XML Schema

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Tue, 7 Jan 2003 10:53:33 +0100 (MET)
To: noah_mendelsohn@us.ibm.com
Cc: mendling@web.de, xmlschema-dev@w3.org
Message-ID: <23868.1041933213@www42.gmx.net>

Hi Noah,

you are right that validation must be performant. Maybe I stated my view on
XPath constraints not clearly enough because it invoked your strong

First: I never said that validation should be processor dependent. Any
conformant processor must check all constraints contained in a schema with the
same result. I suggested that if performance is a matter then people must
carefully decide for example if they really need idendity constraints causing the
evaluation of XPaths during validation.

Second: I proposed that the XPaths used in XPath constraints might be of a
restricted form. Therefore (also in order to ease the implementation of
streaming processors) the ancestor, preceding, or following axes might not be

I think that special co-occurence constraints should not be introduced into
XML schema because it would either catch only very simple cases or be rather
complex. Complexity is already a strong argument that many people raise
against XML schema. In contrast, XPath is already widely accepted and would not
introduce much additional complexity for schema authors.

I could imagine that XPath in the context of validation is augmented with
extension functions that are taylored for common situations of schema
constraints. For example to check that exactly one of two attributes is present the
following general XPath has to be evaluated:

test="@at1 and not(@at2) or not (@at1) and @at2"

This might be checked with an xor extension function:

test="xs:xor(@at1, @at2)"

Such extension functions might improve performance.


> > About performance: I think performance matters should
> > not guide the decision about wheter XPath-Constraints
> > should be added to the schema specification or not. If
> > performance is a matter then people can switch of
> > validation (or use only simple constraints).
> Here I respectfully but strongly disagree.  It's
> essentially that my customers and those with whom they
> do business get consistent results when they validate a
> given document with a given schema.  If they say "Well,
> it was valid with XYZ-Corp.'s high performanc processor
> but not ABC's" we've got a mess.  The main reason to
> use XML is universal consistency and interop.  High
> performance schema processing is very, very important
> to IBM's customers, as is consistency of semantics.  I
> think we can get better co-occurrence constraints
> without sacrificing performance.
> ------------------------------------------------------------------
> Noah Mendelsohn                              Voice: 1-617-693-4036
> IBM Corporation                                Fax: 1-617-693-8676
> One Rogers Street
> Cambridge, MA 02142
> ------------------------------------------------------------------
Received on Tuesday, 7 January 2003 04:53:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:59 UTC