fn.document( $uris as String | String | ValueIterator, [$base-node as Node] ) as ValueIterator
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.
This is an XSLT function, and it is available in both XSLT and in XQuery 1.0-ml.
|$uris||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.|
|$base-node||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.|
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.
fn:document from an
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
second example below.
For the URI to be exactly what you enter, use
fn.document(["/product.xml", "/price.xml"], xdmp.unquote('<a xml:base="http://www.marklogic.com" />'));