OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] xml:base and fragments

> On May 4, 2017, at 8:28 AM, Michael Kay <mike@saxonica.com> wrote:
> The same issue has arisen in XSLT. The XSLT 1.0 description of the document() function states:
> The URI reference may be relative. The base URI (see [3.2 Base URI]) of the node in the second argument node-set that is first in document order is used as the base URI for resolving the relative URI into an absolute URI. If the second argument is omitted, then it defaults to the node in the stylesheet that contains the expression that includes the call to the document function. Note that a zero-length URI reference is a reference to the document relative to which the URI reference is being resolved; thus document("") refers to the root node of the stylesheet; the tree representation of the stylesheet is exactly the same as if the XML document containing the stylesheet was the initial source document.

> The question is does the final "Note that" sentence really mean that the base URI is ignored? (And should a sentence that starts with "Note that" be treated as normative?)

Given the opportunity, I’d class the sentence beginning “Note that” as a note, 
declare it non-normative, and correct its misstatement of the rule.  

RFC 2396 may have wanted the base URI to be ignored, but 3986
appears to offer a perfrectly coherent account that never ignores
the base URI.

> ...
> RFC 3986 retains this ambiguous interpretation: relative URIs are always resolved relative to the base URI. But a "same document reference" is redefined to mean a URI reference whose URI part is the same as the base URI, and (§4.4):
>    When a same-document reference is dereferenced for a retrieval
>    action, the target of that reference is defined to be within the same
>    entity (representation, document, or message) as the reference;
>    therefore, a dereference should not result in a new retrieval action.
> In other words, although the URI part of the URI reference is the base URI, you don't fetch the document at the location identified by the base URI, you return the current document.
> But that's not what the document() function in Saxon does; nor is it what XSLT 2.0/3.0 specify. In XSLT, you get the document at the base-uri location.

If we want to apply all the tools of spec casuistry, it’s worth pointing out
that RFC 3986 does not say a reference to “” MUST not result in a new
retrieval action, only that it SHOULD NOT.  If it does, the text seems to 
be very clear that the URI to be retrieved is the base URI.

So I don’t think XSLT has succeeded in being incompatible with RFC 3986,
even if that was the goal.  (Whew!)

C. M. Sperberg-McQueen
Black Mesa Technologies LLC

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS