org.apache.xml.resolver.tools

Class ResolvingParser

public class ResolvingParser extends Object implements Parser, DTDHandler, DocumentHandler, EntityResolver

Deprecated: This interface has been replaced by the ResolvingXMLReader for SAX2.

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.

Version: 1.0

Author: Norman Walsh Norman.Walsh@Sun.COM

See Also: CatalogResolver org.xml.sax.Parser

Field Summary
static booleannamespaceAware
Make the parser Namespace aware?
static booleansuppressExplanation
Suppress explanatory message?
static booleanvalidating
Make the parser validating?
Constructor Summary
ResolvingParser()
Constructor
Method Summary
voidcharacters(char[] ch, int start, int length)
SAX DocumentHandler API
voidendDocument()
SAX DocumentHandler API
voidendElement(String name)
SAX DocumentHandler API
CataloggetCatalog()
Return the Catalog being used
voidignorableWhitespace(char[] ch, int start, int length)
SAX DocumentHandler API
voidnotationDecl(String name, String publicId, String systemId)
SAX DTDHandler API
voidparse(InputSource input)

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.

voidparse(String systemId)
SAX Parser API
voidprocessingInstruction(String target, String pidata)
SAX DocumentHandler API
InputSourceresolveEntity(String publicId, String systemId)

Implements the resolveEntity method for the SAX interface, using an underlying CatalogResolver to do the real work.

voidsetDocumentHandler(DocumentHandler handler)
SAX Parser API
voidsetDocumentLocator(Locator locator)
SAX DocumentHandler API
voidsetDTDHandler(DTDHandler handler)
SAX Parser API
voidsetEntityResolver(EntityResolver resolver)

SAX Parser API

The purpose of this class is to implement an entity resolver.

voidsetErrorHandler(ErrorHandler handler)
SAX Parser API
voidsetLocale(Locale locale)
SAX Parser API
voidstartDocument()
SAX DocumentHandler API
voidstartElement(String name, AttributeList atts)
SAX DocumentHandler API
voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName)
SAX DTDHandler API

Field Detail

namespaceAware

public static boolean namespaceAware
Make the parser Namespace aware?

suppressExplanation

public static boolean suppressExplanation
Suppress explanatory message?

See Also: parse

validating

public static boolean validating
Make the parser validating?

Constructor Detail

ResolvingParser

public ResolvingParser()
Constructor

Method Detail

characters

public void characters(char[] ch, int start, int length)
SAX DocumentHandler API

endDocument

public void endDocument()
SAX DocumentHandler API

endElement

public void endElement(String name)
SAX DocumentHandler API

getCatalog

public Catalog getCatalog()
Return the Catalog being used

ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)
SAX DocumentHandler API

notationDecl

public void notationDecl(String name, String publicId, String systemId)
SAX DTDHandler API

parse

public void parse(InputSource input)

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)
SAX Parser API

See Also: parse

processingInstruction

public void processingInstruction(String target, String pidata)
SAX 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.

setDocumentHandler

public void setDocumentHandler(DocumentHandler handler)
SAX Parser API

setDocumentLocator

public void setDocumentLocator(Locator locator)
SAX DocumentHandler API

setDTDHandler

public void setDTDHandler(DTDHandler handler)
SAX Parser 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)
SAX Parser API

startDocument

public void startDocument()
SAX DocumentHandler API

startElement

public void startElement(String name, AttributeList atts)
SAX DocumentHandler API

unparsedEntityDecl

public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
SAX DTDHandler API
Copyright B) 2001 Apache. All Rights Reserved.