public class ResolvingParser
implements Parser, DTDHandler, DocumentHandler, EntityResolver
A SAX Parser that performs catalog-based entity resolution.
This class implements a SAX Parser that performs entity resolution
using the CatalogResolver. The actual, underlying parser is obtained
from a SAXParserFactory.
characters
public void characters(char[] ch,
int start,
int length)
throws SAXExceptionSAX DocumentHandler API
endDocument
public void endDocument()
throws SAXExceptionSAX DocumentHandler API
endElement
public void endElement(String name)
throws SAXExceptionSAX DocumentHandler API
getCatalog
public Catalog getCatalog()
Return the Catalog being used
ignorableWhitespace
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXExceptionSAX DocumentHandler API
notationDecl
public void notationDecl(String name,
String publicId,
String systemId)
throws SAXExceptionSAX DTDHandler API
parse
public void parse(InputSource input)
throws IOException,
SAXException SAX Parser API
Note that the JAXP 1.1ea2 parser crashes with an InternalError if
it encounters a system identifier that appears to be a relative URI
that begins with a slash. For example, the declaration:
<!DOCTYPE book SYSTEM "/path/to/dtd/on/my/system/docbookx.dtd">
would cause such an error. As a convenience, this method catches
that error and prints an explanation. (Unfortunately, it's not possible
to identify the particular system identifier that causes the problem.)
The underlying error is forwarded after printing the explanatory
message. The message is only every printed once and if
suppressExplanation is set to
false before
parsing, it will never be printed.
parse
public void parse(String systemId)
throws IOException,
SAXExceptionSAX Parser API
processingInstruction
public void processingInstruction(String target,
String pidata)
throws SAXExceptionSAX DocumentHandler API
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId) Implements the resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work.
setDTDHandler
public void setDTDHandler(DTDHandler handler)
SAX Parser API
setDocumentHandler
public void setDocumentHandler(DocumentHandler handler)
SAX Parser API
setDocumentLocator
public void setDocumentLocator(Locator locator)
SAX DocumentHandler API
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
SAX Parser API
The purpose of this class is to implement an entity resolver.
Attempting to set a different one is pointless (and ignored).
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
SAX Parser API
setLocale
public void setLocale(Locale locale)
throws SAXExceptionSAX Parser API
startDocument
public void startDocument()
throws SAXExceptionSAX DocumentHandler API
startElement
public void startElement(String name,
AttributeList atts)
throws SAXExceptionSAX DocumentHandler API
unparsedEntityDecl
public void unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
throws SAXExceptionSAX DTDHandler API