OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] XPath 1.5? (was RE: [xml-dev] typing and markup)

[ Lists Home | Date Index | Thread Index ]

Rick Jelliffe wrote:

From: "Jonathan Robie" <jonathan.robie@datadirect-technologies.com>

> >The idea that a query system can optimise away, or generate errors on,
> >queries like aaa/bbb if the schema specifies that aaa has no bbb children
> >is also very worrying.
> Indeed.
> Whether or not that is an error is currently an open issue in XQuery. My
> own view is that it should be neither a static nor a dynamic error, but
> that it should evaluate to an empty sequence.

Is that right? There is no way to say "Tell me what is in the document"
if some schema has deemed something impossible.  How the hell can
anyone validate documents-in-progress (which may well be invalid)
using that?

This isn't as bad as you think. One very reasonable interpretation of:


when the schema says this is 'disallowed', indeed that the node list
returned by such an XPath will always be null -- without needing to look at
any particular instance of a document meeting the constraints expressed in
the schema.

So a clever XPath 2 implementation could, I suppose "compile" the "aaa/bbb"
path into a null list (ala constant evaluation).

A Schematron assertion (that the node list is non-null) would then always
fail, even at "compile" time.

I think this behavior would be _better_ for Schematron. This behavior is
expected when you treat a "type" as defining a set of nodes, and why I've
said that XPath 1.0 -today- is viewed as such a type system.



News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS