<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.document.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.document</api:function-name><api:suggest>fn.document</api:suggest><api:suggest>fn</api:suggest><api:suggest>document</api:suggest><api:function-link mode="xquery" fullname="fn:document">/apidoc/8.0/fn:document.xml</api:function-link><api:function mode="javascript" name="document" type="builtin" lib="fn" category="XSLTBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.document"><api:summary>
  <p xmlns="http://www.w3.org/1999/xhtml">Returns the document(s) stored in the database at the specified URI(s).
  The URI(s) are resolved according to the base-uri of the calling
  stylesheet or XQuery main module.  </p>
  <p xmlns="http://www.w3.org/1999/xhtml">This is an XSLT function, and it is available in both XSLT and in
  XQuery 1.0-ml. </p>
</api:summary><api:params><api:param name="uris" type="String | String[] | ValueIterator" optional="false" class="javascript"><api:param-description>
  The $uris is an array or a ValueIterator of the URI(s) of the document(s) 
  to be retrieved.
  This parameter is mandatory. If any URI in this sequence
  is an absolute URI, then it is used as is. If it is a relative
  URI, it is resolved against a base URI specified in the second argument.
  </api:param-description><api:param-name>uris</api:param-name><api:param-type>String | String[] | ValueIterator</api:param-type></api:param><api:param name="base-node" type="node()" optional="true"><api:param-description>
  If $base-node is supplied, its base URI is used to resolve relative
  URIs in uri-sequence. If it is not supplied, the base URI of the node
  that contained the fn:document() call is used.
  </api:param-description><api:param-name>base-node</api:param-name><api:param-type>Node</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
<p xmlns="http://www.w3.org/1999/xhtml">If no second argument is specified, the URI resolves using the base-uri
of the calling module.  This can cause surprising results if the URI you are
resolving is not rooted but the module from which you call it has a base-uri.
When calling <code>fn:document</code> from an <code>xdmp:eval</code>,
the calling module is defined to have no base-uri.  When calling from an
XQuery module or an XSLT stylesheet, the base-uri is the URI of the
module or stylesheet.  For an example to demonstrate this , see the
<a href="#document-resolve">second example</a> below.</p>
<p xmlns="http://www.w3.org/1999/xhtml">For the URI to be exactly what you enter, use
<a href="./fn:doc"><code>fn:doc</code></a> instead.</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.document(["/product.xml", "/price.xml"],
            xdmp.unquote('&lt;a xml:base="http://www.marklogic.com" /&gt;'));
</pre>
</api:example></api:function></api:function-page>