[Bug 11555] [FO3.0] Requirement for path() function

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

--- Comment #1 from Michael Kay <mike@saxonica.com> 2011-02-21 16:07:42 UTC ---
Here is a proposed specification.

fn:path($node as node()) as xs:string

Summary: returns a path expression that can be used to select the supplied node
relative to the root of its containing document.

Rules:
* If $node does not have a document node as an ancestor, an error is raised
[TBA]

* If $node is a document node, the function returns the string "/".

* Otherwise, the function constructs a string that consists of a sequence of
steps, one for each ancestor-or-self of $node 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:

** For an element node, "{uri}":{local}[{position}], where {uri} is the
namespace URI of the node-name or the empty string if the node is in no
namespace, {local} is the local part of the node-name, and {position} is an
integer representing the position of the selected node among its like-named
siblings

** For an attribute node:

--- if the node is in no namespace, @{local}, where {local} is the local part
of the node-name

--- otherwise, @"{uri}":{local}, where {uri} is the namespace URI of the
node-name, and {local} is the local part of the node-name

** For a text node: text()[{position}] where {position} is an integer
representing the position of the selected node among its text node siblings

** For a comment node: comment()[{position}] where {position} is an integer
representing the position of the selected node among its comment node siblings

** For a processing-instruction node:
processing-instruction({local])[{position}] where {local} is the name of the
processing instruction node and {position} is an integer representing the
position of the selected node among its like-named processing-instruction node
siblings

** For a namespace node: namespace::{prefix}, where {prefix} is the local part
of the name of the namespace node (which represents the namespace prefix).

-- 
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 Monday, 21 February 2011 16:07:45 UTC