2 messages in net.sourceforge.lists.saxon-helpRe: [saxon] Bug: Abnormal cases of re...
FromSent OnAttachments
Christoph LANGEDec 11, 2008 2:05 pm 
Michael KayDec 11, 2008 3:03 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [saxon] Bug: Abnormal cases of relative URIs not supported byresolve-uriActions
From:Michael Kay (mi@saxonica.com)
Date:Dec 11, 2008 3:03:36 pm
List:net.sourceforge.lists.saxon-help

Although RFC 3986 obsoletes RFC 2396, the XSLT and XQuery specifications allow implementations to use either. The Saxon/Java result here is as described in RFC 2396, appendix C.2. The specification of resolve-uri(), as given at

http://www.w3.org/XML/2007/qt-errata/xpath-functions-errata.html#E1

says "If $relative is a relative URI reference, it is resolved against $base, or the base-uri property from the static context, using an algorithm such as the ones described in [RFC 2396] or [RFC 3986]". This very permissive wording was deliberately chosen in recognition of the fact that there are corner cases where the two RFCs differ, and that implementations may well need to use underlying libraries which implement one rather than the other, or in some cases have made their own interpretations of a very confusing specification. (Saxon in some cases does things that aren't allowed by either spec, for example it handles the "jar:" URI scheme, which is completely non-conformant with the RFCs. I'm always reluctant to do this, but sometimes pragmatism wins.)

In practice, I will move Saxon forward to use the RFC 3986 rules at such time as a reliable implementation is available in the standard Java library.

-----Original Message----- From: Christoph LANGE [mailto:ch.l@jacobs-university.de] Sent: 11 December 2008 22:06 To: Saxon Subject: [saxon] Bug: Abnormal cases of relative URIs not supported byresolve-uri

Dear Michael,

sorry, I just filed a bug on SourceForge (https://sourceforge.net/tracker/index.php?func=detail&aid=241 8508&group_id=29872&atid=397617) without first posting it here. So here it is again:

One of the "abnormal cases" of relative URI solution is not handled correctly. According to RFC 3986, section 5.4.2, resolve-uri('../../../g', 'http://a/b/c/d;p?q') is supposed to return 'http://a/g', but in Saxon 9.1.0.3 (Java) it returns 'http://a/../g'.

Background why this is relevant for me: My Saxon/XSLT-based XML->RDF extractor Krextor fails on test case 0114 of the W3C RDFa test suite (http://www.w3.org/2006/07/SWD/RDFa/testsuite/).

Cheers, and thanks,