SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
| Introduction
| Writing extension functions in Java
| Converting Arguments to Java Extension Functions
| Converting the Result of a Java Extension Function
| Writing extension functions for .NET
| Converting Arguments to .NET Extension Functions
| Converting the Result of a .NET Extension Function
| Writing XSLT extension instructions
| Customizing Serialization
| Implementing a collating sequence
| Localizing numbers and dates
| Adding an output encoding
» | Writing a URI Resolver for Input Files
| Writing a URI Resolver for Output Files
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# Writing a URI Resolver for Input Files

Saxon allows you to write your own `URIResolver` to handle the URIs of input documents, as defined in the JAXP specification. Such a `URIResolver` is used to process the URIs supplied to the `doc()` and `document()` functions. It is also used to process the URIs supplied for the source document and the stylesheet on the command line. In XSLT it is used to process the URIs used in the `xsl:include` and `xsl:import` and `xsl:import-schema` declarations, and in XQuery it supports the location URIs in `import schema`.

The `URIResolver` is called to process the supplied URI, and it returns a JAXP `Source` object, which Saxon uses as the source of the input. Note that the `Source` must be one of the implementations of `Source` that Saxon recognizes: you cannot write your own implementations of the JAXP `Source` class.

The `URIResolver` is used only for XML files. It is therefore not used to support the `unparsed-text()` function in XSLT, or to support `import module` in XQuery.

Next