[Bug 27908] New: K2-SeqDocFunc-12

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27908

            Bug ID: 27908
           Summary: K2-SeqDocFunc-12
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3 & XPath 3 Test Suite
          Assignee: oneil@saxonica.com
          Reporter: christian.gruen@gmail.com
        QA Contact: public-qt-comments@w3.org

In "K2-SeqDocFunc-12", it is assumed that doc() will never be called. However,
this may not necessarily be the case. It may e.g. be called if $fileToOpen is
statically bound, and if fn:doc is pre-evaluated, in which case FODC0002 would
be raised.

The input of the doc() function (i.e., the atomized value of $fileToOpen) is an
empty string. As the behavior of doc() is implementation-defined, there may be
implementations that raise an error different to FODC0002.

So I propose we should change the value of $fileToOpen to a string that is
guaranteed to raise a well-defined error (e.g. '%gg', leading to 'FODC0005'). 

Does anyone disagree? This is the full test case:

<test><![CDATA[
  declare variable $fileToOpen := <Variable id="_7" name="constComplex2"
type="_11c" context="_1" location="f0:17" file="f0" line="17"/>; 
  empty($fileToOpen//*[let $i := @type return doc($fileToOpen)//*[$i]])
]]></test>
<result>
   <any-of>
      <assert-true/>
      <error code="XPST0005"/>
   </any-of>
</result>

This is a revised proposal:

<test><![CDATA[
  declare variable $fileToOpen := '%gg'; 
  empty(<Variable id="_7" name="constComplex2" type="_11c" context="_1"
location="f0:17" file="f0" line="17"/>//*[let $i := @type return
doc($fileToOpen)//*[$i]])
]]></test>
<result>
   <any-of>
      <assert-true/>
      <error code="XPST0005"/>
      <error code="FODC0005"/>
   </any-of>
</result>

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 27 January 2015 13:42:45 UTC