This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2580 - fn:base-uri(), various tests
Summary: fn:base-uri(), various tests
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.8.2
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-12 10:47 UTC by Martin Probst
Modified: 2006-03-13 11:10 UTC (History)
1 user (show)

See Also:


Attachments

Description Martin Probst 2005-12-12 10:47:08 UTC
* 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 

  and not
    abc 

Comment 1 Carmelo Montanez 2005-12-16 19:48:11 UTC
Martin:

I will follow up on this by next week.

Thanks,
Carmelo
Comment 2 Carmelo Montanez 2006-01-13 15:48:44 UTC
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
Comment 3 Michael Kay 2006-03-08 15:53:09 UTC
I disagree with the change that has been made to fn-base-uri-9. The source document uses

xml:base="http:\\example.com\examples"

The XML Base specification states (section 3.1) that an XML Base processor must "encode and escape" 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
Comment 4 Michael Kay 2006-03-08 15:58:29 UTC
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 "empty".

Michael Kay
Comment 5 Carmelo Montanez 2006-03-08 16:50:36 UTC
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
Comment 6 Martin Probst 2006-03-08 16:59:28 UTC
Mike: I think you're right about fn-base-uri-9, though I don'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: "Document, element and processing-instruction nodes have a base-uri property which may be empty." 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.
Comment 7 Michael Kay 2006-03-08 17:21:34 UTC
It'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't say this in so many words in the spec, but it'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("test.xml"), I would expect it to read by default from c:/temp/test.xml. The only time this doesn't apply might be when the queries and/or source documents are in some kind of XML database.
Comment 8 Martin Probst 2006-03-08 17:37:43 UTC
... 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 "fake" errors to check.
Comment 9 Carmelo Montanez 2006-03-10 19:18:52 UTC
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 "\" to "/" and add a different test whose only pupose is to escape the
"\".  Please Close the bug if in agreement and when able to verify.

Thanks,
Carmelo
Comment 10 Martin Probst 2006-03-13 11:10:28 UTC
I agree.