Re: [xsl] XPath "validation"

Subject: Re: [xsl] XPath "validation"
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 06 Dec 2011 15:52:06 +0000
On 06/12/2011 15:23, Norm Birkett wrote:
Given

(1) an XML schema (expressed in any schema language, though my strong preference would be RNG/C)

and

(2) an XPath path expression (whether XPath 1.0 or 2.0),

it should be possible to compute the "possibility" of the path expression's finding anything in an XML document that is valid under the schema, understood as one of the three following values:

* Guaranteed
* Possible
* Impossible

Question: Does there exist any software to compute "possibility" in this way?
Absolutely. Schema-aware XPath 2.0 (and XSLT/XQuery) processors such as Saxon-EE do exactly this.

Note that it makes much more sense with XSD than with RNG, because XSD associates types with nodes in the instance document, whereas RNG merely assesses validity or non-validity.

Michael Kay
Saxonica

Current Thread