[Bug 16184] [FO30] fn:path() should support fragments as well as documents

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16184

--- Comment #6 from Michael Kay <mike@saxonica.com> 2012-05-29 08:21:43 UTC ---
Herewith a revised proposal.

First, the request talks of "fragments" and "node-set variables" which are not
precise terms in our data model. The proposal here will allow fn:path to
identify a node uniquely within the tree that contains it, whatever the node
kind of the root node of this tree. It does not attempt to allow nodes to be
identified relative to a variable whose value is a sequence of nodes: for
example if $selectedEvents is a sequence of event nodes, it will not generate a
"path" such as $selectedEvents[2]/self::event. The main reason for this is that
it's difficult to come up with a function definition that works for this use
case, given that the same node may appear multiple times within a sequence.

The proposal is as follows:

Change the paragraph that reads:

<old>
Otherwise, the function constructs a string that consists of a sequence of
steps, one for each ancestor-or-self of $arg other than the document node. Each
step consists of the character "/" followed by a string whose form depends on
the kind of node selected by that step, as follows:
</old>

to:

<new>
Otherwise, the function constructs a string that consists of a sequence of
steps, one for each ancestor-or-self of $arg other than the root node. This
string is prefixed by "root()" if the root node is not a document node. Each
step
consists of the character "/" followed by a string whose form depends on the
kind of node selected by that step, as follows:
</new>

Delete the error condition.

Add a note:

<note>
Note that if $arg is a node that has neither a parent nor children (for
example,
a parentless attribute node) then the result of fn:path() will be the string
"root()". If the root node is an element node, then the root will be
represented in
the path by a first step of "root()", without any indication of the element
name.
</note>

Add examples of use with trees whose root is other than a document node.

-- 
Configure bugmail: https://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 Tuesday, 29 May 2012 08:21:54 UTC