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 16369 - [FO30] Invoking fn:error with a static error code.
Summary: [FO30] Invoking fn:error with a static error code.
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-14 15:19 UTC by Ghislain Fourny
Modified: 2012-03-20 18:24 UTC (History)
1 user (show)

See Also:


Attachments

Description Ghislain Fourny 2012-03-14 15:19:10 UTC
I am unsure about the behavior of this query with respect to the spec and versus what one could expect. Perhaps I just overlooked something?

declare namespace err= "http://www.w3.org/2005/xqt-errors";
try {
  fn:error(xs:QName("err:XPST0008"))
} catch err:XPST0008 { 0 }

Possibility 1. F&O says that "the effect of the error is identical to the effect of dynamic errors raised implicitly". It would mean that the error, since it is dynamic, is caught and 0 is returned.
Possibility 2. It is a static error code so one could also expect that it is not caught (although it has been raised dynamically?).

Or, alternatively, would it make sense to raise a dynamic error err:XQDY.... if fn:error is invoked with an error code that is defined in a specification and that is a static error code?
Comment 1 Michael Kay 2012-03-14 17:42:07 UTC
I think that whether an error is static or dynamic is a property of the error, not a property of its QName. Calling the error() function always raises a dynamic error. The fact that the QName is more commonly associated with a static error doesn't change this.
Comment 2 Michael Kay 2012-03-20 18:24:57 UTC
The WG decided to accept the resolution in comment #1.

A non-normative note will be added to the error() function to explain this situation.