com.icl.saxon.trax
Interface URIResolver

All Known Implementing Classes:
StandardURIResolver

public interface URIResolver

This version of URIResolver reflects the proposal made by Michael Kay to revise the interface as defined in TRAX 0.6.

An interface that can be called by the processor to for turning the URIs used in document() and xsl:import etc into an InputSource or a Node if the processor supports the "http://xml.org/trax/features/dom/input" feature.

Node that the URIResolver is stateful (it remembers the most recent URI) so separate instances must be used in each thread.


Method Summary
 org.w3c.dom.Node getDOMNode()
          This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function, if it needs a DOM tree.
 org.xml.sax.InputSource getInputSource()
          This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function, if it needs a SAX InputSource.
 java.lang.String getURI()
          Get the absolute URI.
 org.xml.sax.XMLReader getXMLReader()
          This method returns the SAX2 parser to use with the InputSource obtained from this URI.
 void setURI(java.lang.String base, java.lang.String uri)
          This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function.
 

Method Detail

setURI

public void setURI(java.lang.String base,
                   java.lang.String uri)
            throws TransformException
This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function.
Parameters:
base - The base URI that should be used.
uri - Value from an xsl:import or xsl:include's href attribute, or a URI specified in the document() function.

getURI

public java.lang.String getURI()
Get the absolute URI. This method must not be called unless setURI() has been called first.

getDOMNode

public org.w3c.dom.Node getDOMNode()
                            throws TransformException
This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function, if it needs a DOM tree. The URIResolver must be prepared to return either a DOM tree, or a SAX InputSource, or both. This method must not be called unless setURI() has been called first.

getInputSource

public org.xml.sax.InputSource getInputSource()
                                       throws TransformException
This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function, if it needs a SAX InputSource. The URIResolver must be prepared to return either a DOM tree, or a SAX InputSource, or both. This method must not be called unless setURI() has been called first.

getXMLReader

public org.xml.sax.XMLReader getXMLReader()
                                   throws TransformException
This method returns the SAX2 parser to use with the InputSource obtained from this URI. It may return null if any SAX2-conformant XML parser can be used, or if getInputSource() will also return null. The parser must be free for use (i.e. not currently in use for another parse().