<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3777</bug_id>
          
          <creation_ts>2006-09-29 14:04:03 +0000</creation_ts>
          <short_desc>declare variable $input-context1 external;</short_desc>
          <delta_ts>2006-10-16 11:48:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Mills">tim</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12199</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-09-29 14:04:03 +0000</bug_when>
    <thetext>Refering to a variable declaration of the form:

declare variable $x external;

the XQuery spec states in:

http://www.w3.org/TR/xquery/#id-variable-declarations

that:

&quot;During query analysis, the type of $x is considered to be item()*. &quot;

Thus XQTS tests which start:

declare variable $input-context external;

and use an expression such as $input-context/.... fail typechecking, since such an expression requires node()*, not the more general item()*.

XQTS tests should therefore be changed to use, for example:

declare variable $input-context as node()* external;

Axes001-1 is an example of such a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12200</commentid>
    <comment_count>1</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2006-09-29 14:20:14 +0000</bug_when>
    <thetext>The guidelines says in section Accessing Source Documents:

----------------------------------------
A test harness may use any of the following customizations of the query that is supplied. Note that option 3 and 5 are only applicable for test cases that use one source document.

1. Unchanged: use external variables as indicated in the original query. 
Users of static typing may choose to transform the variable declarations between insert-start and insert-end comments by adding an &quot;as document-node()&quot; clause as illustrated below:
----------------------------------------

So I believe you will need to transform it from your side. One way to do this is to provide the static type for the variable from your external environment. (If you think this is cumbersome I personally agree!)

Therefore I lean towards resolving this report as invalid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12230</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-10-02 08:04:31 +0000</bug_when>
    <thetext>OK.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>