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 21315 - [XP3.0] XPDY0002 - type error or dynamic error
Summary: [XP3.0] XPDY0002 - type error or dynamic error
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-17 16:21 UTC by Michael Kay
Modified: 2013-04-16 17:21 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2013-03-17 16:21:28 UTC
The error XPDY0002 which occurs when the context item is absent is generally described in the XPath spec as a dynamic error but in the F+O spec as a type error.
Comment 1 Jonathan Robie 2013-04-16 15:34:05 UTC
For reference:

err:XPDY0002
It is a dynamic error if evaluation of an expression relies on some part of the dynamic context that is absentDM30 .
Comment 2 Jonathan Robie 2013-04-16 16:12:40 UTC
I propose that we keep this as a dynamic error, and modify the following text:

<quote> if an implementation can determine during the static analysis phase that a QueryBody <add>or FunctionBody</add>, if evaluated, would necessarily raise a dynamic error or that an expression, if evaluated, would necessarily raise a type error, the implementation may (but is not required to) report that error during the static analysis phase.  <add>However, a FunctionBody should not raise such  error statically simply because invoking the function would invoke fn:error().</quote>
Comment 3 Jonathan Robie 2013-04-16 16:21:39 UTC
I believe the status quo is that it is a dynamic error. I think our choices are:

* Keep the status quo, make consistent in F&O
* Change to a type error
* Keep the status quo, make consistent in F&O, and allow dynamic errors to be raised statically in a function body.
Comment 4 Jonathan Robie 2013-04-16 16:32:19 UTC
The Working Groups have decided XPDY0002 is a dynamic error, and F&O will be changed to reflect that.

We will not make the change proposed in Comment #2 during CR because it is too large a change at this stage of our progression.
Comment 5 Michael Kay 2013-04-16 17:21:59 UTC
Test cases try-016 and try-017 added.