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($node as gnode()?:=., $options as map(*)?:={}) ➔ xs:string?

Arguments

 

$node

gnode()?

:= .

The node whose path is to be determined

 

$options

map(*)?

:= {}

Options map

Result

xs:string?

Namespace

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

Links to W3C specifications

XPath 3.1 Functions and Operators

XPath 4.0 Functions and Operators

Saxon availability

Available in XPath 3.0, XSLT 3.0, XQuery 3.0, and later versions. From Saxon 9.6, available in all editions. Available for all platforms.

Notes on the Saxon implementation

Fully available since Saxon 9.6. Available since Saxon 9.4 provided XPath 3.0 is enabled. Replaces the extension function saxon:path which is retained for the time being.