[Bug 6340] New: [FO] Editorial: fn:base-uri()

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6340

           Summary: [FO] Editorial: fn:base-uri()
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


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.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 1 January 2009 23:58:15 UTC