The
document( ) function loads the XML document at
the URI specified by the first argument and returns a node-set
containing that document's root node. The URI is
normally given as a string, but may be given as another type that is
converted to a string. If the URI is given as a node-set, then each
node in the set is converted to a string, and the returned node-set
includes root nodes of all documents referenced by the URI argument.
If the URI contains a fragment identifier, then the node-set returned
may indicate something other than the root node and thus contain more
than one node. If an error occurs while retrieving a document, most
XSLT processors stop processing the stylesheet.
The document( ) function may also take a node-set
as an optional second argument, in which case the first node (in
document order) in this set is used as the base URI with which to
resolve relative URIs given in the first argument. If the second
argument is omitted, then base URIs are resolved relative to the
stylesheet's location.