Name

URIResolver

Synopsis

This interface allows an application to tell a Transformer how to resolve the URIs that appear in an XSLT stylesheet. If you pass a URIResolver to the setURIResolver( ) method of a Transformer or TransformerFactory then when the Transformer or TransformerFactory encounters a URI, it first passes that URI, along with the base URI to the resolve( ) method of the URIResolver. If resolve( ) returns a Source object, then the Transformer will use that Source. If a Transformer or TransformerFactory has no URIResolver registered, or if the resolve( ) method returns null, then the tranformer or factory will attempt to resolve the URI itself.

public interface URIResolver {
// Public Instance Methods
     Source resolve(String href, String base) throws TransformerException;  
}

Passed To

Transformer.setURIResolver( ), TransformerFactory.setURIResolver( )

Returned By

Transformer.getURIResolver( ), TransformerFactory.getURIResolver( )

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.