dls:link-expand( $context as node(), $ref as element(xi:include), $restriction as cts:query? ) as node()*
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
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; declare namespace xi="http://www.w3.org/2001/XInclude"; let $node := fn:doc("/foo/bar/baz.xml") return dls:link-expand($node, $node/BOOK/xi:include[1], ()) (: Returns the first referenced node in the 'BOOK' element in the latest version of the 'baz.xml' document. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.