xdmp.path

xdmp.path(
   node as Node,
   [include-document as Boolean?]
) as String

Summary

Returns a string whose value corresponds to the path of the node.

Parameters
node The node whose path is returned.
include-document If true, then the path is presented with a leading doc(..)/.., otherwise the path is presented as /...

Example

var arg = fn.head(xdmp.unquote('<a><b><c>ccc</c></b> <b>bbb</b></a>')
               ).root;
xdmp.path(arg.xpath("./b[1]/c"));

  => "/a/b[1]/c"
Powered by MarkLogic Server | Terms of Use | Privacy Policy