org.apache.xml.resolver.tools
ResolvingXMLReader
for SAX2.public class ResolvingParser extends Object implements Parser, DTDHandler, DocumentHandler, EntityResolver
This class implements a SAX Parser that performs entity resolution using the CatalogResolver. The actual, underlying parser is obtained from a SAXParserFactory.
CatalogResolver
,
Parser
Modifier and Type | Field and Description |
---|---|
static boolean |
namespaceAware
Deprecated.
Make the parser Namespace aware?
|
static boolean |
suppressExplanation
Deprecated.
Suppress explanatory message?
|
static boolean |
validating
Deprecated.
Make the parser validating?
|
Constructor and Description |
---|
ResolvingParser()
Deprecated.
Constructor.
|
ResolvingParser(CatalogManager manager)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Deprecated.
SAX DocumentHandler API.
|
void |
endDocument()
Deprecated.
SAX DocumentHandler API.
|
void |
endElement(String name)
Deprecated.
SAX DocumentHandler API.
|
Catalog |
getCatalog()
Deprecated.
Return the Catalog being used.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Deprecated.
SAX DocumentHandler API.
|
void |
notationDecl(String name,
String publicId,
String systemId)
Deprecated.
SAX DTDHandler API.
|
void |
parse(InputSource input)
Deprecated.
SAX Parser API.
|
void |
parse(String systemId)
Deprecated.
SAX Parser API.
|
void |
processingInstruction(String target,
String pidata)
Deprecated.
SAX DocumentHandler API.
|
InputSource |
resolveEntity(String publicId,
String systemId)
Deprecated.
Implements the
resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work. |
void |
setDocumentHandler(DocumentHandler handler)
Deprecated.
SAX Parser API.
|
void |
setDocumentLocator(Locator locator)
Deprecated.
SAX DocumentHandler API.
|
void |
setDTDHandler(DTDHandler handler)
Deprecated.
SAX Parser API.
|
void |
setEntityResolver(EntityResolver resolver)
Deprecated.
SAX Parser API.
|
void |
setErrorHandler(ErrorHandler handler)
Deprecated.
SAX Parser API.
|
void |
setLocale(Locale locale)
Deprecated.
SAX Parser API.
|
void |
startDocument()
Deprecated.
SAX DocumentHandler API.
|
void |
startElement(String name,
AttributeList atts)
Deprecated.
SAX DocumentHandler API.
|
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
Deprecated.
SAX DTDHandler API.
|
public static boolean namespaceAware
public static boolean validating
public static boolean suppressExplanation
parse(InputSource)
public ResolvingParser()
public ResolvingParser(CatalogManager manager)
public Catalog getCatalog()
public void parse(InputSource input) throws IOException, SAXException
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
in interface Parser
IOException
SAXException
public void parse(String systemId) throws IOException, SAXException
parse
in interface Parser
IOException
SAXException
parse(InputSource)
public void setDocumentHandler(DocumentHandler handler)
setDocumentHandler
in interface Parser
public void setDTDHandler(DTDHandler handler)
setDTDHandler
in interface Parser
public void setEntityResolver(EntityResolver resolver)
The purpose of this class is to implement an entity resolver. Attempting to set a different one is pointless (and ignored).
setEntityResolver
in interface Parser
public void setErrorHandler(ErrorHandler handler)
setErrorHandler
in interface Parser
public void setLocale(Locale locale) throws SAXException
setLocale
in interface Parser
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface DocumentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface DocumentHandler
SAXException
public void endElement(String name) throws SAXException
endElement
in interface DocumentHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface DocumentHandler
SAXException
public void processingInstruction(String target, String pidata) throws SAXException
processingInstruction
in interface DocumentHandler
SAXException
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface DocumentHandler
public void startDocument() throws SAXException
startDocument
in interface DocumentHandler
SAXException
public void startElement(String name, AttributeList atts) throws SAXException
startElement
in interface DocumentHandler
SAXException
public void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl
in interface DTDHandler
SAXException
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
unparsedEntityDecl
in interface DTDHandler
SAXException
public InputSource resolveEntity(String publicId, String systemId)
resolveEntity
method
for the SAX interface, using an underlying CatalogResolver
to do the real work.resolveEntity
in interface EntityResolver
Copyright © 2015 The Apache Software Foundation. All Rights Reserved.