Loading TOC...

dls:link-expand

dls:link-expand(
   $context as node(),
   $ref as element(xi:include),
   $restriction as cts:query?
) as node()*

Summary

This function performs a single level expansion of a single XInclude reference. Any XInclude references in the referenced node are not expanded.

Parameters
context The node that contains the XInclude reference.
ref The XInclude reference to be expanded.
restriction Restriction that control which documents may be considered for inclusion. An exact URI match is first considered if it matches the specified restrictions, followed by the most recent numbered version of that URI that matches the restrictions.

Required Privileges

The dls-user role is required to run this function, or the privilege:
http://marklogic.com/xdmp/privileges/dls-user

Example

  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 iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.