<?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>2580</bug_id>
          
          <creation_ts>2005-12-12 10:47:08 +0000</creation_ts>
          <short_desc>fn:base-uri(), various tests</short_desc>
          <delta_ts>2006-03-13 11:10:28 +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>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="Martin Probst">martin</reporter>
          <assigned_to name="Carmelo Montanez">carmelo</assigned_to>
          <cc>mike</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7383</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Probst">martin</who>
    <bug_when>2005-12-12 10:47:08 +0000</bug_when>
    <thetext>* fn-base-uri-9
  expects the URI to be escaped in the result, but 
    http://www.w3.org/TR/xpath-functions/#constructor-functions
  defines constructor functions to behave as casting, and
    http://www.w3.org/TR/xpath-functions/#casting-to-string
  defines that not escaping takes place when casting from string to xs:anyURI.

* fn-base-uri-11
  Expects fn:base-uri() to return something when no base uri is set on the
argument. Spec says:
    If $arg is the empty sequence, the empty sequence is returned.

* base-URI-18
  Escaping issue with the expected result, should be
    abc &amp;#xa;
  and not
    abc &amp;amp;#xa;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7499</commentid>
    <comment_count>1</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2005-12-16 19:48:11 +0000</bug_when>
    <thetext>Martin:

I will follow up on this by next week.

Thanks,
Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7819</commentid>
    <comment_count>2</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-01-13 15:48:44 +0000</bug_when>
    <thetext>Martin:

Correct.  Changed expected results for fn-base-uri-9 and fn-base-uri-11.
base-uri-18 was addressed by a different bug and the results were changed
as well.  Please close the bug when able to confirm.

Thanks,
Carmelo Montanez</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8624</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-03-08 15:53:09 +0000</bug_when>
    <thetext>I disagree with the change that has been made to fn-base-uri-9. The source document uses

xml:base=&quot;http:\\example.com\examples&quot;

The XML Base specification states (section 3.1) that an XML Base processor must &quot;encode and escape&quot; any invalid characters in the URI to make it into a valid URI. This means that the effective base URI, after XML base processing, is http:%5C%5Cexample.com%5Cexamples, and this is what the base-uri() function should report.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8625</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-03-08 15:58:29 +0000</bug_when>
    <thetext>I also disagree with the change that has been made to base-uri-11. The XQuery specification is clear (3.7.3.3) that the document node constructor produces a document node whose base URI is taken from the static context (that is, from the base URI of the query.) There is no reason for this to be &quot;empty&quot;.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8630</commentid>
    <comment_count>5</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-03-08 16:50:36 +0000</bug_when>
    <thetext>Mike/Martin:

I will bring this with the Test Task Force on Thursday and hopefully have
a final version on Friday.  Sorry I been sick last few days and unable
to follow up on things.

Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8631</commentid>
    <comment_count>6</comment_count>
    <who name="Martin Probst">martin</who>
    <bug_when>2006-03-08 16:59:28 +0000</bug_when>
    <thetext>Mike: I think you&apos;re right about fn-base-uri-9, though I don&apos;t really have a clue about the xml:base spec.

Regarding fn-base-uri-11, what would be the proper version in your opinion? Spec says: &quot;Document, element and processing-instruction nodes have a base-uri property which may be empty.&quot; The query does not declare a base-uri, so the accessor dm:base-uri() should return the empty sequence, to my understanding. My quoting of the spec was wrong though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8632</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-03-08 17:21:34 +0000</bug_when>
    <thetext>It&apos;s a bit environment dependent, but I would expect most systems that read the    query text from a file to allocate a static base URI based on that filename. We don&apos;t say this in so many words in the spec, but it&apos;s what base URI is all about: when a file such as an XML document, HTML document, or Query contains a relative URI, then by default it is resolved relative to the location of that file. For example if a query in c:/temp/test.xq does doc(&quot;test.xml&quot;), I would expect it to read by default from c:/temp/test.xml. The only time this doesn&apos;t apply might be when the queries and/or source documents are in some kind of XML database.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8635</commentid>
    <comment_count>8</comment_count>
    <who name="Martin Probst">martin</who>
    <bug_when>2006-03-08 17:37:43 +0000</bug_when>
    <thetext>... or in Java source code.

Actually in X-Hive you can only execute XQueries against a Document, Library or a single Node, so we always have some kind of a context URI, too. Because of that we cannot run several conformance tests that expect the context item to be empty.

I would opt not to make the tests depend on implementation defined items. I had quite a lot of issues related to time zones, various context settings, available collations etc. It just decreases the usefulness of the test suite as you get a lot more &quot;fake&quot; errors to check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8663</commentid>
    <comment_count>9</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-03-10 19:18:52 +0000</bug_when>
    <thetext>Mike/Martin:

I think (corect me if I am wrong) that is conceivable that fn-base-uri-11 may
return 0 or 1 depending on what the implementation does.  I think the thing to do is allow for either value.

Regarding fn-base-uri-9.  I will like to take a two step approach.  The original idea behind the test was not to have an invalid uri (my typo), so I will change the &quot;\&quot; to &quot;/&quot; and add a different test whose only pupose is to escape the
&quot;\&quot;.  Please Close the bug if in agreement and when able to verify.

Thanks,
Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8698</commentid>
    <comment_count>10</comment_count>
    <who name="Martin Probst">martin</who>
    <bug_when>2006-03-13 11:10:28 +0000</bug_when>
    <thetext>I agree.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>