fn.document( uris as String | String[] | Sequence, [base-node as Node] ) as Sequence
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.
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 fn:document
from an xdmp:eval
,
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:doc
instead.
fn.document(["/product.xml", "/price.xml"], xdmp.unquote('<a xml:base="http://www.marklogic.com" />'));
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.