dls:link-references( $node as node(), $restriction as cts:query? ) as xs:string*
This function returns a list of all the distinct URIs of documents referenced (either directly or indirectly) in the expansion of the node. The URIs are mapped according to the specified restrictions.
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"; let $node := fn:doc("/foo/bar/baz.xml") return dls:link-references($node, dls:document-version-query(4)) (: Returns the URIs of the referenced nodes in Version 4 of the 'baz.xml' document and all of the referenced nodes referenced from its referenced nodes. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.