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
The XPath API
Standards Conformance
Extensibility
| Introduction
| Writing extension functions
| Converting Arguments to Extension Functions
| Converting the Result of an Extension Function
| Writing extension instructions
| Writing input filters
| Writing output filters
| 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
XSLT Patterns

# 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