W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2009

RE: [XML Schema 1.1] I respectfully recommend these changes to <assert> and <alternative>

From: Michael Kay <mike@saxonica.com>
Date: Tue, 12 May 2009 15:17:51 +0100
To: "'G. Ken Holman'" <gkholman@CraneSoftwrights.com>, <xmlschema-dev@w3.org>
Message-ID: <A58E4691D2014DADA49C492F471BCE34@Sealion>
> Think of validating a 20Gb document made up of:
>    <logs>
>      <log .... />
>      <log .... />
>      <log .... />
>      ...
>    </logs>
> Very simple to validate as a pattern.  A *big* burden to 
> support assertions for the entire tree.
> I'm not on the committee, but I suspect the requirement to 
> keep an entire document tree in memory for validation is a 
> non-starter.  Whereas dealing with all of the information 
> about an element and its attributes can be done easily 
> because that is where the validator is at the time.
> . . . . . . . . . . . Ken

If you change that to 

<logs count="28654">

Then I think it's perfectly reasonable to have an assertion at the top level
that says

test="@count = count(log)"

And indeed the specification allows you to do so. Some implementations will
be able to handle this efficiently; some won't. Users will have to make
decisions (about designing their schemas, and about choosing their products)
that take this into account.

So I don't think the argument based on performance is overriding. The main
reason for not allowing navigation outside a subtree is the theory that a
type defines a set of instances, and that the set of instances of a type
doesn't depend on the phase of the moon.


Michael Kay
Received on Tuesday, 12 May 2009 14:18:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:51 UTC