This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 11073 - Type errors during XPath evaluation
Summary: Type errors during XPath evaluation
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2010-10-16 18:24 UTC by Michael Kay
Modified: 2011-03-04 23:54 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2010-10-16 18:24:47 UTC
In section 3.12.4 (CTA) it is stated that "If a dynamic error or a type error is raised during evaluation, then the {test} is treated as if it had evaluated (without error) to false."

This is then glossed in a Note: "Dynamic errors and type errors in the evaluation of {test} expressions cause neither the schema nor the document instance to be invalid."

The reader could be forgiven for missing the significance of the phrase "during evaluation" | "in the evaluation" in these sentences. Neither is intended to apply to type errors that are detected statically. XPath processors are at liberty to detect type errors statically, and such errors should be handled in the same way as syntax errors in the XPath expression - that is, a violation of the constraints on schema documents. It would be easy enough to add to the note the sentence: "However, if type errors are detected statically by the XPath processor, the effect is the same as for other static errors in the XPath expression."

This then raises the question that 3.12.6 states:

"The {expression} property of the XPath Expression is a valid XPath expression, as defined in [XPath 2.0]."

However, XPath 2.0 does not define the term "valid XPath expression". I think that what is intended is "an XPath expression containing no static errors".

The text for assertions in 3.13.6.2 makes the same mistake in referring to "valid XPath expressions."

For evaluation of assertions, I can't find any text equivalent to that in CTA that says dynamic errors cause the assertion to be treated as false. Perhaps I missed it.
Comment 1 David Ezell 2010-11-05 14:12:33 UTC
In Lyon:

Replace the term "Valid XPath Expression" with a more correct term, or define what we mean by "Valid XPath Expression", and specify that in the case of dynamic errors, assertions always evaluate to FALSE.  It's implementation defined when type errors are detected, and whther they are treated as static or dynamic.
Comment 3 C. M. Sperberg-McQueen 2011-03-04 23:05:03 UTC
The proposal mentioned in comment 2 has been integrated into the status-quo document as amended.