saxon:doc
Fetches and parses an XML document, with supplied parsing options.
doc($href as xs:string, $options as map(*)) ➔ document-node()
Arguments | |||
| $href | xs:string | The URI of the document to be fetched |
| $options | map(*) | Parsing options |
Result | document-node() |
Namespace
http://saxon.sf.net/
Saxon availability
Requires Saxon-PE or Saxon-EE.
Notes on the Saxon implementation
Introduced in Saxon 9.8.
Details
This function has a similar effect to fn:doc($href)
, but allows
an extra argument to be supplied (in the form of a map) to control the way
in which the document is parsed.
The available options are:
Name | Type | Values |
---|---|---|
validation |
xs:string |
|
type |
xs:QName |
Requests validation against a named type. |
dtd-validation |
xs:boolean |
Determines whether DTD validation takes place. |
strip-space |
xs:string |
|
accumulators |
xs:QName* |
Names the accumulators that are applicable to this document. |
use-xsi-schema-location |
xs:boolean |
Controls whether or not to use the |
Note: the saxon:doc
function was introduced as a target for compiling
the XSLT 3.0 xsl:source-document
instruction when streaming is not in force.
It is however useful in its own right.
In the current implementation, the function returns a new document on each call. This is not guaranteed, however; future versions may decide to cache the results so that two calls with the same arguments return the same node.