This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
XPST0081 is defined to be: "It is a static error if a QName used in a query contains a namespace prefix that cannot be expanded into a namespace URI by using the statically known namespaces." XPST0005 is defined to be: "It is a static error if an expression refers to an ... namespace prefix, or ... that is not defined in the static context, except for an ElementName in an ElementTest or an AttributeName in an AttributeTest." XPST0081 seems to cover one of the cases of XPST0008 (namely undefined namespace prefixes). I may be wrong, but I suspect XPST0008 can therefore never be thrown in that case and should be defined as: "It is a static error if an expression refers to an element name, attribute name, schema type name, or variable name that is not defined in the static context, except for an ElementName in an ElementTest or an AttributeName in an AttributeTest."
Tim, The Query working group discussed this bug report on 8 Jan 2008. The group observed that the XQuery specification does not in general guarantee that error conditions are not overlapping. Section 2.3.1 of the specification states "If more than one error is present, or if an error condition comes within the scope of more than one error defined in this specification, then any non-empty subset of these errors may be reported." For example, if both XPST0008 and XPST0081 apply to a given expression, then either or both of these errors may be raised. If you accept this resolution, please mark this bug report as "Closed". Regards, --Don Chamberlin (for the XQuery working group)
OK. I would like to suggest that in any future version of XQuery which supports some sort of try/catch mechanism, it would be nice if error conditions were non-overlapping, as this might aid interoperability.