<?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>29582</bug_id>
          
          <creation_ts>2016-04-20 17:54:58 +0000</creation_ts>
          <short_desc>[QT3] relative URIs in app-Walmsley tests</short_desc>
          <delta_ts>2016-06-07 10:51:50 +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 3 &amp; XPath 3 Test Suite</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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="Michael Kay">mike</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>christian.gruen</cc>
    
    <cc>debbie</cc>
          
          <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>125951</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-04-20 17:54:58 +0000</bug_when>
    <thetext>The way in which the tests in test-set app-Walmsley use relative URIs is inconsistent with other parts of the test suite and creates difficulties for the test driver.

A typical example is test d1e11215, which includes the function call

doc(&quot;catalog.xml&quot;)

This is intended as a reference to the resource described in the environment as

&lt;source role=&quot;.&quot; file=&quot;Walmsley/catalog.xml&quot; uri=&quot;catalog.xml&quot;/&gt;

The query is in an XML file

/some/path/app/Walmsley.xml

and the required file can be found in

/some/path/app/Walmsley/catalog.xml

The problem is that the doc() function is supposed to resolve the relative URI against the base URI of the query, and the base URI of the query is file:///some/path/app/Walmsley.xml. The absolute URI is therefore 

file:///some/path/app/catalog.xml

and it&apos;s difficult from this to identify the &lt;source&gt; element in the environment. It works if (in JAXP, for example) you can write a URIResolver that is given the base URI and the relative URI separately, but the language specs don&apos;t encourage that: whereas it&apos;s fine for the absolute URI to be redirected by some external lookup mechanism (&quot;the static context&quot;) there&apos;s no suggestion in our specs of the JAXP mechanism where the relative and base URI are separately available to the lookup mechanism.

It&apos;s tempting to suggest fixing this by adding a &lt;static-base-uri&gt; element to the environment, but the test catalog specification says that this must be an absolute URI.

I therefore suggest that we should change these tests to use relative URIs that resolve properly, without redirection, to the documents that the tests are intended to use.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125988</commentid>
    <comment_count>1</comment_count>
    <who name="Debbie Lockett">debbie</who>
    <bug_when>2016-04-21 11:21:45 +0000</bug_when>
    <thetext>I have modified the environment to supply an absolute static-base-uri, and use this for the supplied resources, as per Mike&apos;s first suggestion (this was decided to be less disruptive than modifying the relative URIs in lots of tests individually).

This fix broke the test d1e78807b, which uses fn:transform() and saves the output to the supplied base-output-uri. So I have modified this test (and its environment) to use relative URIs that resolve properly (without redirection).

Apologies for getting this wrong in the first place. Note that the tests were supplied by Priscilla Walmsley, but I added the test set to the test suite, supposedly after sorting out any issues...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126310</commentid>
    <comment_count>2</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2016-05-02 10:34:24 +0000</bug_when>
    <thetext>Due to this change, the discussed tests are now failing with our test engine.

I am sorry I cannot give an easy explanation so far; it will take me some more time to find out what’s the new problem. I managed to locally fix the test case issues by replacing all occurrences of doc(&quot;catalog.xml&quot;) with doc(&quot;http://www.w3.org/2010/09/qt-fots-catalog/Walmsley/catalog.xml&quot;). Do you think this would be an option? Are there some other implementors out there that have similar problems with the changes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126311</commentid>
    <comment_count>3</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2016-05-02 11:12:57 +0000</bug_when>
    <thetext>I still have no idea how to properly resolve the static base uri in this context (and I am pretty sure I would only need it to do justice to these few test cases).

I didn’t find a similar pattern in the other test cases that use fn:doc (in most of them, the URI seems to be bound to a variable), but I noticed that things are (I believe) handled more easily in other test cases. See &quot;UseCaseR31-030&quot; for example: It directly addresses &quot;UseCaseR31/Wikipedia-Origami.xml&quot; in the doc function, and there is not source element addressing it.

Maybe things can be resolved as follows?

a) address the document via &quot;Walmsley/catalog.xml&quot;

b) drop the old &lt;source&gt; element
  &lt;source role=&quot;.&quot; file=&quot;Walmsley/catalog.xml&quot; uri=&quot;catalog.xml&quot;/&gt;

c) update the test cases (d1e41635, d1e41648?) that rely on the context item</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126312</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-05-02 11:26:59 +0000</bug_when>
    <thetext>I think the tests are correct as written and the pattern is consistent with other tests such as those in unparsed-text-available using the environment unparsed-text-available-with-base-uri.

The relative URI supplied to the doc() function is resolved against the static base URI defined in the test environment to give an absolute URI equal to that under which the document is registered in the environment; I&apos;m not sure which part of this mechanism you think is wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126323</commentid>
    <comment_count>5</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2016-05-03 14:43:59 +0000</bug_when>
    <thetext>Thanks for your feedback, Michael. In that case, I will spend some more time on our test suite. I would like to hear your opinion about test case &quot;UseCaseJSON-008&quot;, which resembles the old app-Walmsley pattern:

  https://github.com/LeoWoerteler/QT3TS/blob/master/app/UseCaseJSON.xml#L225-L244
  https://github.com/LeoWoerteler/QT3TS/blob/master/app/UseCaseJSON.xml#L57-L60

Do you think that a static base URI needs to be added for this test case as well?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126686</commentid>
    <comment_count>6</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2016-06-07 10:51:50 +0000</bug_when>
    <thetext>Yes I agree the test case UseCaseJSON-008 requires the same fix. Fix committed to cvs.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>