Loading TOC...


   [arg as Node?]
) as Node?


Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.

If $arg is the empty sequence, the empty sequence is returned.

If $arg is a document node, $arg is returned.

If the function is called without an argument, the context item is used as the default argument. If the context item is undefined an error is raised: [err:XPDY0002]. If the context item is not a node an error is raised: [err:XPTY0004].

arg The node whose root node will be returned.


var doc = fn.head(xdmp.unquote('<a><quantity>5.0</quantity></a>')
<?xml version="1.0" encoding="UTF-8"?>

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.