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 29099 - try-catch-variable-binding-outside-4 should be modified so that err:XPTY0004 can not be detected during static evaluation
Summary: try-catch-variable-binding-outside-4 should be modified so that err:XPTY0004 ...
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Josh Spiegel
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-28 21:40 UTC by Josh Spiegel
Modified: 2015-10-06 18:01 UTC (History)
2 users (show)

See Also:


Attachments

Description Josh Spiegel 2015-08-28 21:40:13 UTC
<test-case name="try-catch-variable-binding-outside-4" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
    <description>If a variable reference is used in a try clause, errors raised by binding a value to the variable are not caught unless the binding expression occurs within the try clause.</description>
    <created by="Ghislain Fourny" on="2011-07-28"/>
    <environment ref="err"/>
    <test><![CDATA[try { for $x as xs:integer in (0, 1, "") return $x } catch err:XPTY0004 { 0 }]]></test>
    <result>
      <assert-eq>0</assert-eq>
    </result>
  </test-case>

Implementations may be able to detect XPTY0004 and raise it during static evaluation. Here is one way to prevent detection during static evaluation:

   declare variable $str external := "";
   try {
      for $x as xs:integer in (0, 1, $str)
      return $x
   } catch err:XPTY0004 {
      0
   }
Comment 1 O'Neil Delpratt 2015-09-15 11:30:04 UTC
The working group agrees with the proposal by Josh. I am reassinging this bug to Josh to fix.
Comment 2 Michael Kay 2015-10-06 09:11:28 UTC
Revert apparent vandalism (status change).
Comment 3 O'Neil Delpratt 2015-10-06 18:01:35 UTC
I believe this has been fixed in cvs. Marking it as resolved.