ResolvingXMLReaderpublic class ResolvingXMLFilter
extends org.xml.sax.helpers.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 | Description |
|---|---|---|
static boolean |
suppressExplanation |
Suppress explanatory message?
|
| Constructor | Description |
|---|---|
ResolvingXMLFilter() |
Construct an empty XML Filter with no parent.
|
ResolvingXMLFilter(CatalogManager manager) |
Construct an XML filter with the specified parent.
|
ResolvingXMLFilter(org.xml.sax.XMLReader parent) |
Construct an XML filter with the specified parent.
|
ResolvingXMLFilter(org.xml.sax.XMLReader parent,
CatalogManager manager) |
Construct an XML filter with the specified parent.
|
| Modifier and Type | Method | Description |
|---|---|---|
Catalog |
getCatalog() |
Provide accessto the underlying Catalog.
|
void |
notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId) |
SAX DTDHandler API.
|
void |
parse(java.lang.String systemId) |
SAX XMLReader API.
|
void |
parse(org.xml.sax.InputSource input) |
SAX XMLReader API.
|
void |
processingInstruction(java.lang.String target,
java.lang.String pidata) |
SAX ContentHandler API.
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId) |
Implements the
resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts) |
SAX ContentHandler API.
|
void |
unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName) |
SAX DTDHandler API.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcharacters, 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(org.xml.sax.XMLReader parent)
public ResolvingXMLFilter(CatalogManager manager)
public ResolvingXMLFilter(org.xml.sax.XMLReader parent,
CatalogManager manager)
public Catalog getCatalog()
public void parse(org.xml.sax.InputSource input)
throws java.io.IOException,
org.xml.sax.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 class org.xml.sax.helpers.XMLFilterImpljava.io.IOExceptionorg.xml.sax.SAXExceptionpublic void parse(java.lang.String systemId)
throws java.io.IOException,
org.xml.sax.SAXException
parse in class org.xml.sax.helpers.XMLFilterImpljava.io.IOExceptionorg.xml.sax.SAXExceptionparse(InputSource)public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work.resolveEntity in class org.xml.sax.helpers.XMLFilterImplpublic void notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.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 class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXExceptionpublic void unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
throws org.xml.sax.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 class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXExceptionpublic void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.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 class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXExceptionpublic void processingInstruction(java.lang.String target,
java.lang.String pidata)
throws org.xml.sax.SAXException
Detect and use the oasis-xml-catalog PI if it occurs.
processingInstruction in class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXExceptionCopyright ? 2001-2003 Apache Software Foundation. All Rights Reserved.