org.apache.xml.resolver.tools
public class CatalogResolver extends Object implements EntityResolver, URIResolver
This class implements both a SAX EntityResolver and a JAXP URIResolver.
This resolver understands OASIS TR9401 catalogs, XCatalogs, and the current working draft of the OASIS Entity Resolution Technical Committee specification.
Version: 1.0
See Also: Catalog org.xml.sax.EntityResolver javax.xml.transform.URIResolver
Field Summary | |
---|---|
boolean | namespaceAware Make the parser Namespace aware? |
boolean | validating Make the parser validating? |
Constructor Summary | |
---|---|
CatalogResolver() Constructor | |
CatalogResolver(boolean privateCatalog) Constructor | |
CatalogResolver(CatalogManager manager) Constructor |
Method Summary | |
---|---|
Catalog | getCatalog() Return the underlying catalog |
String | getResolvedEntity(String publicId, String systemId)
Implements the guts of the resolveEntity method
for the SAX interface.
|
Source | resolve(String href, String base) JAXP URIResolver API |
InputSource | resolveEntity(String publicId, String systemId)
Implements the resolveEntity method
for the SAX interface.
|
resolveEntity
method
for the SAX interface.
Presented with an optional public identifier and a system identifier, this function attempts to locate a mapping in the catalogs.
If such a mapping is found, it is returned. If no mapping is found, null is returned.
Parameters: publicId The public identifier for the entity in question. This may be null. systemId The system identifier for the entity in question. XML requires a system identifier on all external entities, so this value is always specified.
Returns: The resolved identifier (a URI reference).
resolveEntity
method
for the SAX interface.
Presented with an optional public identifier and a system identifier, this function attempts to locate a mapping in the catalogs.
If such a mapping is found, the resolver attempts to open the mapped value as an InputSource and return it. Exceptions are ignored and null is returned if the mapped value cannot be opened as an input source.
If no mapping is found (or an error occurs attempting to open the mapped value as an input source), null is returned and the system will use the specified system identifier as if no entityResolver was specified.
Parameters: publicId The public identifier for the entity in question. This may be null. systemId The system identifier for the entity in question. XML requires a system identifier on all external entities, so this value is always specified.
Returns: An InputSource for the mapped identifier, or null.