<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="extensibility" page="uri-resolver" subpage=""/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Writing a URI Resolver for Input Files</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Writing a URI Resolver for Input Files"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Writing a URI Resolver for Input Files</h1> <p>Saxon allows you to write your own <code>URIResolver</code> to handle the URIs of input documents, as defined in the JAXP specification. Such a <code>URIResolver</code> is used to process the URIs supplied to the <code>doc()</code> and <code>document()</code> 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 <code>xsl:include</code> and <code>xsl:import</code> and <code>xsl:import-schema</code> declarations, and in XQuery it supports the location URIs in <code>import schema</code>.</p> <p>The <code>URIResolver</code> is called to process the supplied URI, and it returns a JAXP <code>Source</code> object, which Saxon uses as the source of the input. Note that the <code>Source</code> must be one of the implementations of <code>Source</code> that Saxon recognizes: you cannot write your own implementations of the JAXP <code>Source</code> class.</p> <p>The <code>URIResolver</code> is used only for XML files. It is therefore not used to support the <code>unparsed-text()</code> function in XSLT, or to support <code>import module</code> in XQuery.</p> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="output-uri-resolver.xml">Next</a></p> </td> </tr> </table> </body> </html>