dls.linkExpand( context as Node, ref as element(xi.include), restriction as cts.query? ) as Sequence
This function performs a single level expansion of a single XInclude reference. Any XInclude references in the referenced node are not expanded.
dls-user
role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
// Returns the first referenced node in the 'BOOK' element in the // latest version of the 'baz.xml' document. const dls = require('/MarkLogic/dls'); let node = cts.doc('/foo/bar/baz.xml'); dls.linkExpand(node, node.xpath('/BOOK/xi:include[1]', {'xi': 'http://www.w3.org/2001/XInclude'}), null);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.