fn:path

This function takes as input a node (defaulting to the context node), and returns an XPath expression defining a path to that node from the root of its containing tree (which must be a document node). The path will use expanded QNames so that it is not sensitive to the namespace context.

path() ➔ xs:string

There are no arguments

Result

xs:string

path($arg as node()?) ➔ xs:string?

Arguments

 

$arg

node()?

The node whose path is to be determined

Result

xs:string?

Namespace

http://www.w3.org/2005/xpath-functions

Links to W3C specifications

XPath 3.0 Functions and Operators

Notes on the Saxon implementation

Implemented since Saxon 9.4, provided XPath 3.0 is enabled; replaces the extension function saxon:path which is retained for the time being.