public class ResolvingXMLFilter extends XMLFilterImpl
This class implements a SAX XMLFilter that performs entity resolution using the CatalogResolver. The actual, underlying parser is obtained from a SAXParserFactory.
CatalogResolver,
XMLFilter| Modifier and Type | Field and Description |
|---|---|
static boolean |
suppressExplanation
Suppress explanatory message?
|
| Constructor and Description |
|---|
ResolvingXMLFilter()
Construct an empty XML Filter with no parent.
|
ResolvingXMLFilter(CatalogManager manager)
Construct an XML filter with the specified parent.
|
ResolvingXMLFilter(XMLReader parent)
Construct an XML filter with the specified parent.
|
ResolvingXMLFilter(XMLReader parent,
CatalogManager manager)
Construct an XML filter with the specified parent.
|
| Modifier and Type | Method and Description |
|---|---|
Catalog |
getCatalog()
Provide accessto the underlying Catalog.
|
void |
notationDecl(String name,
String publicId,
String systemId)
SAX DTDHandler API.
|
void |
parse(InputSource input)
SAX XMLReader API.
|
void |
parse(String systemId)
SAX XMLReader API.
|
void |
processingInstruction(String target,
String pidata)
SAX ContentHandler API.
|
InputSource |
resolveEntity(String publicId,
String systemId)
Implements the
resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work. |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
SAX ContentHandler API.
|
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
SAX DTDHandler API.
|
characters, endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, warningpublic static boolean suppressExplanation
parse(InputSource)public ResolvingXMLFilter()
public ResolvingXMLFilter(XMLReader parent)
public ResolvingXMLFilter(CatalogManager manager)
public ResolvingXMLFilter(XMLReader parent, 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 XMLReaderparse in class XMLFilterImplIOExceptionSAXExceptionpublic void parse(String systemId) throws IOException, SAXException
parse in interface XMLReaderparse in class XMLFilterImplIOExceptionSAXExceptionparse(InputSource)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 EntityResolverresolveEntity in class XMLFilterImplpublic void notationDecl(String name, String publicId, String systemId) throws SAXException
Captured here only to detect the end of the prolog so that we can ignore subsequent oasis-xml-catalog PIs. Otherwise the events are just passed through.
notationDecl in interface DTDHandlernotationDecl in class XMLFilterImplSAXExceptionpublic void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
Captured here only to detect the end of the prolog so that we can ignore subsequent oasis-xml-catalog PIs. Otherwise the events are just passed through.
unparsedEntityDecl in interface DTDHandlerunparsedEntityDecl in class XMLFilterImplSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
Captured here only to detect the end of the prolog so that we can ignore subsequent oasis-xml-catalog PIs. Otherwise the events are just passed through.
startElement in interface ContentHandlerstartElement in class XMLFilterImplSAXExceptionpublic void processingInstruction(String target, String pidata) throws SAXException
Detect and use the oasis-xml-catalog PI if it occurs.
processingInstruction in interface ContentHandlerprocessingInstruction in class XMLFilterImplSAXExceptionCopyright © 2005–2017 Oracle Corporation. All rights reserved.