Skip to content

XSLT document() Function

How to use the XSLT document() function to access and retrieve data from external XML documents in your transformations.

XSLT document() Function

The document function is used to access nodes in an external XML document. The external XML document must be valid and parsable.

One way to use this function is to look up data in an external document. For example, we want to find the value Celsius from a Fahrenheit value, and we reference a document that contains some precomputed results:

<xsl:value-of select="document('celsius.xml')/celsius/result[@value=$value]"/>

Syntax

node-set document(object,node-set?)

Input Parameters

Parameter Required/Optional Description
object Required Defines an URI to an external XML document
node-set Optional Used to resolve relative URI
Navigation