Class Summary : TXMLFilterImpl

Buffered Base class for deriving an XML filter.

This class is designed to sit between an IXMLReader and the client application's event handlers. By default, it does nothing but pass requests up to the reader and events on to the handlers unmodified, but subclasses can override specific methods to modify the event stream or the configuration requests as they pass through.

Methods

procedure setupParse()
procedure setParent(IXMLReader)
function getParent() : IXMLReader
function getFeature(SAXString) : Boolean
procedure setFeature(SAXString, Boolean)
function getProperty(SAXString) : IProperty
procedure setEntityResolver(IEntityResolver)
function getEntityResolver() : IEntityResolver
procedure setDTDHandler(IDTDHandler)
function getDTDHandler() : IDTDHandler
procedure setContentHandler(IContentHandler)
function getContentHandler() : IContentHandler
procedure setErrorHandler(IErrorHandler)
function getErrorHandler() : IErrorHandler
procedure parse(IInputSource)
procedure parse(SAXString)
function resolveEntity(SAXString, SAXString) : IInputSource
procedure notationDecl(SAXString, SAXString, SAXString)
procedure unparsedEntityDecl(SAXString, SAXString, SAXString, SAXString)
procedure setDocumentLocator(ILocator)
procedure startDocument()
procedure endDocument()
procedure startPrefixMapping(SAXString, SAXString)
procedure endPrefixMapping(SAXString)
procedure startElement(SAXString, SAXString, SAXString, IAttributes)
procedure endElement(SAXString, SAXString, SAXString)
procedure characters(SAXString)
procedure ignorableWhitespace(SAXString)
procedure processingInstruction(SAXString, SAXString)
procedure skippedEntity(SAXString)
procedure warning(ISAXParseError)
procedure error(ISAXParseError)
procedure fatalError(ISAXParseError)


procedure setupParse();

Set up before a parse.

Before every parse, check whether the parent is non-nil, and re-register the filter for all of the events.


Top


procedure setParent(const parent : IXMLReader);

Set the parent reader.

This is the IXMLReader from which this filter will obtain its events and to which it will pass its configuration requests. The parent may itself be another filter.

If there is no parent reader set, any attempt to parse or to set or get a feature or property will fail.


Parameter : parent The parent reader.
See : TXMLFilterImpl.getParent

Top


function getParent() : IXMLReader;

Get the parent reader.

This method allows the application to query the parent reader (which may be another filter). It is generally a bad idea to perform any operations on the parent reader directly: they should all pass through this filter.


Result : The parent filter, or nil if none has been set.
See : TXMLFilterImpl.setParent

Top


function getFeature(const name : SAXString) : Boolean;

Look up the value of a feature.

This will always fail if the parent is nil.


Parameter : name The feature name.
Result : The current value of the feature.
Exception : ESAXNotRecognizedException If the feature value can't be assigned or retrieved from the parent.
Exception : ESAXNotSupportedException When the parent recognizes the feature name but cannot determine its value at this time.

Top


procedure setFeature(const name : SAXString; value : Boolean);

Set the value of a feature.

This will always fail if the parent is nil.


Parameter : name The feature name.
Parameter : value The requested feature value.
Exception : ESAXNotRecognizedException If the feature value can't be assigned or retrieved from the parent.
Exception : ESAXNotSupportedException When the parent recognizes the feature name but cannot set the requested value.

Top


function getProperty(const name : SAXString) : IProperty;

Look up the interface value of a property.
Parameter : name The property name.
Parameter : value The current value of the property as an interface.
Exception : ESAXNotRecognizedException If the property interface value can't be retrieved from the parent.
Exception : ESAXNotSupportedException When the parent recognizes the property name but cannot determine its interface at this time.

Top


procedure setEntityResolver(const resolver : IEntityResolver);

Set the entity resolver.
Parameter : resolver The new entity resolver.

Top


function getEntityResolver() : IEntityResolver;

Get the current entity resolver.
Result : The current entity resolver, or nil if none was set.

Top


procedure setDTDHandler(const handler : IDTDHandler);

Set the DTD event handler.
Parameter : resolver The new DTD handler.

Top


function getDTDHandler() : IDTDHandler;

Get the current DTD event handler.
Result : The current DTD handler, or nil if none was set.

Top


procedure setContentHandler(const handler : IContentHandler);

Set the content event handler.
Parameter : resolver The new content handler.

Top


function getContentHandler() : IContentHandler;

Get the content event handler.
Result : The current content handler, or nil if none was set.

Top


procedure setErrorHandler(const handler : IErrorHandler);

Set the error event handler.
Parameter : handle The new error handler.

Top


function getErrorHandler() : IErrorHandler;

Get the current error event handler.
Result : The current error handler, or nil if none was set.

Top


procedure parse(const input : IInputSource);

Parse a document.
Parameter : input The input source for the document entity.
Exception : ESAXException Any SAX exception.

Top


procedure parse(const systemId : SAXString);

Parse a document.
Parameter : systemId The system identifier as a fully-qualified URI.
Exception : ESAXException Any SAX exception.

Top


function resolveEntity(const publicId : SAXString; const systemId : SAXString) : IInputSource;

Filter an external entity resolution.
Parameter : publicId The entity's public identifier, or null.
Parameter : systemId The entity's system identifier.
Result : A new InputSource or null for the default.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure notationDecl(const name : SAXString; const publicId : SAXString; const systemId : SAXString);

Filter a notation declaration event.
Parameter : name The notation name.
Parameter : publicId The notation's public identifier, or null.
Parameter : systemId The notation's system identifier, or null.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure unparsedEntityDecl(const name : SAXString; const publicId : SAXString; const systemId : SAXString; const notationName : SAXString);

Filter an unparsed entity declaration event.
Parameter : name The entity name.
Parameter : publicId The entity's public identifier, or null.
Parameter : systemId The entity's system identifier, or null.
Parameter : notationName The name of the associated notation.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure setDocumentLocator(const locator : ILocator);

Filter a new document locator event.
Parameter : locator The document locator.

Top


procedure startDocument();

Filter a start document event.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure endDocument();

Filter an end document event.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure startPrefixMapping(const prefix : SAXString; const uri : SAXString);

Filter a start Namespace prefix mapping event.
Parameter : prefix The Namespace prefix.
Parameter : uri The Namespace URI.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure endPrefixMapping(const prefix : SAXString);

Filter an end Namespace prefix mapping event.
Parameter : prefix The Namespace prefix.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure startElement(const uri : SAXString; const localName : SAXString; const qName : SAXString; const atts : IAttributes);

Filter a start element event.
Parameter : uri The element's Namespace URI, or the empty string.
Parameter : localName The element's local name, or the empty string.
Parameter : qName The element's qualified (prefixed) name, or the empty string.
Parameter : atts The element's attributes.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure endElement(const uri : SAXString; const localName : SAXString; const qName : SAXString);

Filter an end element event.
Parameter : uri The element's Namespace URI, or the empty string.
Parameter : localName The element's local name, or the empty string.
Parameter : qName The element's qualified (prefixed) name, or the empty string.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure characters(const ch : SAXString);

Filter a character data event.
Parameter : ch The characters in the XML Document.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure ignorableWhitespace(const ch : SAXString);

Filter an ignorable whitespace event.
Parameter : ch The characters in the XML Document.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure processingInstruction(const target : SAXString; const data : SAXString);

Filter a processing instruction event.
Parameter : target The processing instruction target.
Parameter : data The text following the target.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure skippedEntity(const name : SAXString);

Filter a skipped entity event.
Parameter : name The name of the skipped entity.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure warning(const e : ISAXParseError);

Filter a warning event.
Parameter : e The warning as an exception.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure error(const e : ISAXParseError);

Filter an error event.
Parameter : e The error as an exception.
Exception : ESAXException The client may throw an exception during processing.

Top


procedure fatalError(const e : ISAXParseError);

Filter a fatal error event.
Parameter : e The error as an exception.
Exception : ESAXException The client may throw an exception during processing.

Top