[XPath] Error Codes

Looking at appendix F of the XPath language book:

Errors XP0001 and XP0002 between them do not cover all cases, because
evaluation of an expression may depend on a value in the static context
(e.g. the base URI).

Error XP0008 includes XP0017 as a subset (and XP0017 starts "It is It
is")

XP0002 includes XP0018 as a subset

XP0007 would appear to belong in F+O

XP0006 includes XP0019 as a subset

XP0055 applies to attribute tests as well as to element tests

Using the namespace axis with a processor that doesn't support it raises
error XP0021, but this is described in appendix F as an casting error.

The error text for XP0019 says that it's an error if the result of a
step expression is not a sequence of nodes. But 17 and "london" are both
step expressions. The context where this error is introduced (in 3.2)
makes it clear that it's referring to both operands of the "/" operator.
But it's not clear why this isn't just a generic type error (XP0006).


There seem to be a number of errors that don't have codes allocated:

- target type of a cast is not atomic

- violation of the consistency constraints in section 2.2.5

- no entry in operator table for the actual types of the operands


There seem to be cases where more specialized error codes would be
useful:

- "unknown types" in sequence type matching (2.4.4) should not give the
same error as an incorrect but known type


The description of casting in the XPath book duplicates the description
of casting in F+O. The two descriptions allocate different error codes
to the same error conditions. Which text is normative?

The distinction between the two casting errors XP0021 and XP0029 isn't
clear. Reading the descriptions in the appendix and the descriptions in
the body of the document gives different impressions as to the
difference between the two cases. In any event, it seems odd to have two
different codes for these two subtly-different cases when other error
codes are much less specialized. 



Note also typo in 3.2.1.1:

"XPath defines a set of full set of axes"


Michael Kay

Received on Sunday, 8 February 2004 16:42:24 UTC