| XQUERY/XSLT API DOCUMENTATION 4.2 |
All XQuery & XSLT Functions MarkLogic Built-In Functions Admin (xdmp:) AppServer (xdmp:) Classifier (cts:) Debug (dbg:) Document Conversion (xdmp:) Extension (xdmp:) Documents, Directories, Properties, and Locks Functions Extension Functions Function Values Functions HTTP Functions JSON Functions MarkLogic Server Functions Search Functions XML Functions XQuery Context Functions XSLT Functions map (map:) Math (math:) Profile (prof:) Search (cts:) cts:query Constructors Functions Geospatial Functions Geospatial Lexicon Functions Lexicon Functions Search Functions Search Clustering Functions Security (xdmp:) Server Monitoring (xdmp:) Spell (spell:) Update (xdmp:) XQuery Library Modules Admin Library (admin:) Actions Functions Appserver Functions Database Functions Forest Functions Group Functions Host Functions Mimetypes Functions Scheduler Functions Alerting (alert:) Elastic Compute Cloud (ec2:) Entity Enrichment (entity:) Flexible Replication (flexrep:) Geospatial Supporting Functions GEO Functions GeoRSS Functions GML Functions KML Functions MCGM Functions Information Studio (info:) Information Studio Developer (infodev:) Library Services (dls:) cts:query Constructor Functions Document Management Functions Document Update Functions Retention Policy Functions XInclude Functions Modular Documents XInclude Functions XPointer Functions PKI (pki:) Plugin (plugin:) Search (search:) Security-sec (sec:) Spelling Dictionary Management (spell:) Thesaurus (thsr:) Triggers (trgr:) Triggers Library (trgr:) WordProcessingML (ooxml:) ZIP Package (ooxml:) CPF Functions Content Processing Framework (cpf:) CSS Conversion (css:) DocBook Conversion (dbk:) Domains (dom:) Excel Conversion (excel:) Generic Conversion (cvt:) Links (lnk:) MSWord Conversion (msword:) PDF Conversion (pdf:) Pipelines (p:) Powerpoint Conversion (ppt:) XHTML Conversion (xhtml:) W3C-Standard Functions Accessor (fn:) AnyURI (fn:) Boolean (fn:) Context (fn:) DurationDateTime (fn:) Error and Trace (fn:) Node (fn:) Numeric (fn:) QName (fn:) Sequence (fn:) String (fn:) XSLT (fn:) W3C XQuery/XSLT Reference W3C XQuery Functions W3C XQuery Language W3C XSLT Language
This page was generated September 12, 2012 6:02 AM | XQuery & XSLT Built-In & Modules Function Reference
Module: Modular Documents
This is the XInclude module, which is used with the modular documents CPF application. To use the XInclude module as part of your own XQuery module, include the following line in your XQuery prolog: `import module namespace xinc = "http://marklogic.com/xinclude" at "/MarkLogic/xinclude/xinclude.xqy";` The library namespace prefix `xinc` is not predefined in the server. This is the XPointer module, which is used with the modular documents CPF application. To use the XPointer module as part of your own XQuery module, include the following line in your XQuery prolog: `import module namespace xp = "http://marklogic.com/xinclude/xpointer" at "/MarkLogic/xinclude/xpointer.xqy";` The library namespace prefix `xp` is not predefined in the server.
Function Summary
xinc:link-expand | This function performs a single level expansion of a single XInclude reference.
xinc:link-references | This function returns a list of all the distinct URIs of documents referenced (either directly or indirectly) in the expansion of the node.
xinc:node-expand | This function recursively examines the node for XInclude references and expands them, following the rules of the XInclude specification.
xp:dereference | This function resolves an XPointer in the context of a particular node.
Function Detail
xinc:link-expand(
| $context as node(),
| $ref as element(xi:include)
) as node()*
Summary: This function performs a single level expansion of a single XInclude reference. XInclude references in the referenced node will not be expanded.
Parameters:
$context : The root node containing the XInclude reference, which is used for the interpretation of relative links with empty href attributes.
$ref : An XInclude include element.
Usage Notes: Since this function only performs a single-level expansion of a single reference, applications will typically call node-expand instead.
Example:
      xquery version "1.0-ml";
      import module namespace xinc = "http://marklogic.com/xinclude"
    		  at "/MarkLogic/xinclude/xinclude.xqy";

      declare namespace xi="http://www.w3.org/2001/XInclude";

      let $root := fn:doc("http://example.org/mydoc.xml")
      return xinc:link-expand( $root, $root/section[1]/xi:include[1] )
xinc:link-references(
| $node as node()
) as xs:string*
Summary: This function returns a list of all the distinct URIs of documents referenced (either directly or indirectly) in the expansion of the node.
Parameters:
$node : The node containing XInclude references.
Example:
      xquery version "1.0-ml";
      import module namespace xinc = "http://marklogic.com/xinclude"
    		  at "/MarkLogic/xinclude/xinclude.xqy";

      xinc:link-references(fn:doc("http://example.org/mydoc.xml"))
xinc:node-expand(
| $node as node()
) as node()
Summary: This function recursively examines the node for XInclude references and expands them, following the rules of the XInclude specification. The result is a node in which all the XInclude references have been resolved, or an error if there were unresolvable references with no fallback specifications.
Parameters:
$node : The node to expand.
Usage Notes: URI references are resolved against the current database.
Example:
      xquery version "1.0-ml";
      import module namespace xinc = "http://marklogic.com/xinclude"
    		  at "/MarkLogic/xinclude/xinclude.xqy";

      xinc:node-expand( fn:doc("http://example.org/mydoc.xml") )
xp:dereference(
| $context as node(),
| $xpointer as xs:string
) as node()*
Summary: This function resolves an XPointer in the context of a particular node.
Parameters:
$context : The node against which the XPointer evaluates.
$xpointer : An XPointer.
Example:
      xquery version "1.0-ml"
      import module namespace xp = "http://marklogic.com/xinclude/xpointer"
    		  at "/MarkLogic/xinclude/xpointer.xqy";

      let $node :=
         <root xmlns="http://marklogic.com/myns">
           <this>
             This is text before the referenced element.
             <that>The referenced element.</that>
             This is text after the referenced element.
           </this>
         </root>
      return
         xp:dereference($node,
            "xmlns(ns=http://marklogic.com/myns) xpath(//ns:this/ns:that)")

    ===> <that xmlns="http://marklogic.com/myns">The referenced element.</that>

© Copyright 2002-2012 MarkLogic Corporation. All rights reserved.