XSLT document() Function
Definition and Usage
The document() function is used to access nodes in an external XML document. The external XML document must be valid and parseable.
This function provides a method to retrieve other XML resources from the XSLT style sheet in addition to the initial data provided by the input stream.
One way to use this function is to find data in an external document. For example, we want to find the Celsius value corresponding to the Fahrenheit value, so we accessed the document containing pre-calculated values:
<xsl:value-of select="document('celsius.xml')/celsius/result[@value=$value]"/>
Syntax
node-set document(object,node-set?)
Parameters
Parameters | Description |
---|---|
object | Required. Defines the URI of the external XML document. |
node-set | Optional. Used to parse relative URIs. |