org.apache.xml.resolver.helpers
Class BootstrapResolver

java.lang.Object
  extended by org.apache.xml.resolver.helpers.BootstrapResolver
All Implemented Interfaces:
URIResolver, EntityResolver

public class BootstrapResolver
extends java.lang.Object
implements EntityResolver, URIResolver

A simple bootstrapping resolver.

This class is used as the entity resolver when reading XML Catalogs. It searches for the OASIS XML Catalog DTD, Relax NG Grammar and W3C XML Schema as resources (e.g., in the resolver jar file).

If you have your own DTDs or schemas, you can extend this class and set the BootstrapResolver in your CatalogManager.

Version:
1.0
Author:
Norman Walsh Norman.Walsh@Sun.COM
See Also:
CatalogManager

Field Summary
static java.lang.String xCatalogPubId
          Public identifier for legacy Apache XCatalog files.
static java.lang.String xmlCatalogPubId
          Public identifier for OASIS XML Catalog files.
static java.lang.String xmlCatalogRNG
          URI of the RELAX NG Grammar for OASIS XML Catalog files.
static java.lang.String xmlCatalogSysId
          System identifier for OASIS XML Catalog files.
static java.lang.String xmlCatalogXSD
          URI of the W3C XML Schema for OASIS XML Catalog files.
 
Constructor Summary
BootstrapResolver()
          Constructor.
 
Method Summary
 Source resolve(java.lang.String href, java.lang.String base)
          Transformer resolve API.
 InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          SAX resolveEntity API.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlCatalogXSD

public static final java.lang.String xmlCatalogXSD
URI of the W3C XML Schema for OASIS XML Catalog files.

See Also:
Constant Field Values

xmlCatalogRNG

public static final java.lang.String xmlCatalogRNG
URI of the RELAX NG Grammar for OASIS XML Catalog files.

See Also:
Constant Field Values

xmlCatalogPubId

public static final java.lang.String xmlCatalogPubId
Public identifier for OASIS XML Catalog files.

See Also:
Constant Field Values

xmlCatalogSysId

public static final java.lang.String xmlCatalogSysId
System identifier for OASIS XML Catalog files.

See Also:
Constant Field Values

xCatalogPubId

public static final java.lang.String xCatalogPubId
Public identifier for legacy Apache XCatalog files. There is no official system identifier for XCatalog files.

See Also:
Constant Field Values
Constructor Detail

BootstrapResolver

public BootstrapResolver()
Constructor.

Method Detail

resolveEntity

public InputSource resolveEntity(java.lang.String publicId,
                                 java.lang.String systemId)
SAX resolveEntity API.

Specified by:
resolveEntity in interface EntityResolver
Parameters:
publicId - The public identifier of the external entity being referenced, or null if none was supplied.
systemId - The system identifier of the external entity being referenced.
Returns:
An InputSource object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier.
See Also:
InputSource

resolve

public Source resolve(java.lang.String href,
                      java.lang.String base)
               throws TransformerException
Transformer resolve API.

Specified by:
resolve in interface URIResolver
Parameters:
href - An href attribute, which may be relative or absolute.
base - The base URI against which the first argument will be made absolute if the absolute URI is required.
Returns:
A Source object, or null if the href cannot be resolved, and the processor should try to resolve the URI itself.
Throws:
TransformerException - if an error occurs when trying to resolve the URI.