<?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>3660</bug_id>
          
          <creation_ts>2006-09-06 16:06:09 +0000</creation_ts>
          <short_desc>Unclear what to do on external variable with no value</short_desc>
          <delta_ts>2006-09-14 12:01:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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="Frans Englich">frans.englich</reporter>
          <assigned_to name="Don Chamberlin">chamberl</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>11416</commentid>
    <comment_count>0</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2006-09-06 16:06:09 +0000</bug_when>
    <thetext>What is an implementation supposed to do on this query?

    declare variable $thisVarIsNotRecognized external;
    $thisVarIsNotRecognized

In 4.14 Variable Declaration it is asserted that &quot;If the variable declaration includes the keyword external, a value must be provided for the variable by the external environment before the query can be evaluated.&quot; Note the assertion(&quot;must&quot;) and the absence of an instruction on what to do if the assertion does not hold.

It seems XSL-T 2.0 handles this with a specific error code, XTDE0050(http://www.w3.org/TR/xslt20/#err-XTDE0050). This is actually what Saxon raises, which demonstrates the lack of coverage in the XQTS and probably also the specification.

I don&apos;t see how XPST0008 is supposed to be raised, since 4.14 Variable Declaration reads &quot;A variable declaration adds the static type of a variable to the in-scope variables&quot;.

It seems that an error code is needed for when a lookup fails in the &apos;variable values&apos;(dynamic context property) since the same paragraph says &quot;and may also add a value for the variable to the variable values&quot;.

Therefore, with my current view on this, I suggest adding an error code that:

* Must be raised if a variable reference to an external variable does not have a corresponding value in the &apos;variable values&apos;.
* May be raised statically when encountering an external variable declaration that the external environment doesn&apos;t have a value for.

The latter point ensure the 1) error can be consistently reported regardless of if the variable is used; 2) allow implementations to report the error without tracking use; and 3) still allows implementations to report it at runtime.


Frans</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11430</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-09-06 19:24:07 +0000</bug_when>
    <thetext>&gt;It seems XSL-T 2.0 handles this with a specific error code,
XTDE0050(http://www.w3.org/TR/xslt20/#err-XTDE0050). This is actually what
Saxon raises, which demonstrates the lack of coverage in the XQTS and probably
also the specification.

For the record, XSLT also allows you to specify whether or not the parameter is required, and if it is optional, the default value. The error code applies only if the parameter is mandatory. Such facilities would be very useful in XQuery too!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11686</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2006-09-14 00:19:28 +0000</bug_when>
    <thetext>Frans,
On Sept. 12, 2006, the Query Working Group decided that referencing an unbound external variable should raise error XPDY0002. Section 3.1.2 (Variable References) in the XQuery specification will be edited accordingly. If you are satisfied with this resolution, please change the status of this bug report to &quot;Closed&quot;.
Regards,
Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>