<?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>2626</bug_id>
          
          <creation_ts>2005-12-31 17:19:25 +0000</creation_ts>
          <short_desc>base-URI-10</short_desc>
          <delta_ts>2006-05-12 15:02:07 +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>0.8.2</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="David Carlisle">davidc</reporter>
          <assigned_to name="Carmelo Montanez">carmelo</assigned_to>
          
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7569</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-12-31 17:19:30 +0000</bug_when>
    <thetext>has expected reult 0 (implying that static-base-uri() returns () )
However the static base-uri has to be an absolute URI according to 2.1.1 in
particular it has to be non null and so the result of this test should be 1.
(Actually this is slightly surprising, I would have expected that the base URI
was allowed to be &quot;&quot; to accomodate in-memory queries and other cases where there
is no obvious base URI, but that isn&apos;t what the XQuery CR says, and even in that
case, the base URI would be normally set and so this test should return 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7641</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-01-05 18:16:08 +0000</bug_when>
    <thetext>The Base URI property in the static context can undefined. Appendix C.1, Static
Context Components, in XQuery 1.0 says that its default initial value is none.

The beginning of section 2.1.1, Static Context, recognizes that components can
be undefined when it says,

&quot;If analysis of an expression relies on some component of the static context
that has not been assigned a value, a static error is raised [err:XPST0001].&quot;

If you agree with this resoution, then please make this bug report as closed.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7658</commentid>
    <comment_count>2</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2006-01-05 22:13:28 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The Base URI property in the static context can undefined. Appendix C.1, Static
&gt; Context Components, in XQuery 1.0 says that its default initial value is none.
&gt; 
&gt; The beginning of section 2.1.1, Static Context, recognizes that components can
&gt; be undefined when it says,
&gt; 
&gt; &quot;If analysis of an expression relies on some component of the static context
&gt; that has not been assigned a value, a static error is raised [err:XPST0001].&quot;
&gt; 
&gt; If you agree with this resoution, then please make this bug report as closed.
&gt; 

Your observation confirms my initial report. If the base uri is unset then an
error will be raised. so there will be no returned value. This would be the case
in situations where the query is an in-memory string or some other construct
with no uri. When reading the query from the filesystem (as in my test case
harness) surely any implementation
will set this to the URI of the query? in which case the value of count() will be 1.

In neither case can the returned value be 0 which is the result given in the
expected result file.

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7824</commentid>
    <comment_count>3</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-01-13 18:43:02 +0000</bug_when>
    <thetext>I am not sure all implementations will will set teh base uri to the URI of the 
query.  Clearly the base-uri property is undefined (at least it seems so to 
me).  That being the case the description of the function specifies a  that 
the empty sequence be returned.

Should a error needs to be raise then there seems to be an inconsitency 
between this function&apos;s description and the query specs.  

Thanks,
Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7829</commentid>
    <comment_count>4</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2006-01-13 22:53:52 +0000</bug_when>
    <thetext>I was wrong about 0 not being possible. (Sorry, it happens:-)
You are correct to say that the function is defined to return () rather than
error if base-uri is not set.

However it is clearly allowed that the static-base-uri is set if there is a URI
that may be assigned to the query. Saxon and xq2xsl both set it to the URI of
the file if the query has been read from a file. There was a thread on the
public query talk list this month about other possible strategies other
implementations use for setting this property. So clearly 1 has to be an
expected result result in addition to 0 (or the test could be changed to be
something like 
fn:count(fn:static-base-uri())=(0,1)
with an expected result of true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7952</commentid>
    <comment_count>5</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-01-23 18:23:28 +0000</bug_when>
    <thetext>Added extra expected result and resubmitted.  Was easier to add extra
results than changing test.  Please close the bug when able to verify.

Thanks,
Carmelo</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>