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 6340 - [FO] Editorial: fn:base-uri()
Summary: [FO] Editorial: fn:base-uri()
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-01 23:58 UTC by Michael Kay
Modified: 2009-03-06 19:33 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2009-01-01 23:58:01 UTC
The description of fn:base-uri starts "Returns the value of the base-uri URI property". Here "URI" is clearly superfluous and wrong. However, as so often happens with F&O, closer reading reveals the whole spec to be a mess. The Summary is not a summary. The spec is completely confused between the base-uri *property* of the node as defined in XDM, and the dm:base-uri *accessor* as defined in XDM. Much of what it says is actually a paraphrase of the XDM definition of the dm:base-uri accessor, but this is not made clear. The following suggested rewrite makes text that duplicates XDM into a Note:

Summary: Returns the base URI of a node.

The zero-argument version of the function returns the base URI of the context node: it is equivalent to calling fn:base-uri(.). This may result in an error being raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.

The single-argument version of the function behaves as follows:

1. If $arg is the empty sequence, the function returns the empty sequence.

2. Otherwise, the function returns the value of the dm:base-uri accessor applied to the node $arg. This accessor is defined, for each kind of node, in the XDM specification (see Section 5.2 base-uri AccessorDM).

<note>As explained in XDM, document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property for all other node kinds is the empty sequence. The dm:base-uri accessor returns the base-uri property of a node if it exists and is non-empty; otherwise it returns the result of applying the dm:base-uri accessor to its parent, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a parentless node whose base-uri property is empty, the empty sequence is returned. In the case of namespace nodes, however, the result is always an empty sequence -- it does not depend on the base URI of the parent element.</note>

See also fn:static-base-uri.
Comment 1 Michael Kay 2009-01-27 16:41:33 UTC
Approved by the WG on 27 Jan 2009
Comment 2 Michael Kay 2009-02-23 17:47:03 UTC
Although the decision was not minuted, the WG confirmed on 23 Feb that this change was agreed. Noted that the change has not been made in the current draft of the 1.1 spec.
Comment 3 Jim Melton 2009-03-06 19:18:37 UTC
Because the WG has confirmed its resolution of this bug, I am marking it RESOLVED/FIXED.  If you agree with this solution, please mark it CLOSED. 
Comment 4 Michael Kay 2009-03-06 19:33:43 UTC
Now applied to baseline text for 1.1.