Class Summary : TBufferedXMLFilterImpl
Buffered Base class for deriving an XML filter.
This class is designed to sit between an IBufferedXMLReader
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(IBufferedXMLReader)
function
getParent() : IBufferedXMLReader
function
getFeature(SAXString) : Boolean
procedure
setFeature(SAXString, Boolean)
function
getProperty(SAXString) : IProperty
procedure
setEntityResolver(IEntityResolver)
function
getEntityResolver() : IEntityResolver
procedure
setDTDHandler(IBufferedDTDHandler)
function
getDTDHandler() : IBufferedDTDHandler
procedure
setContentHandler(IBufferedContentHandler)
function
getContentHandler() : IBufferedContentHandler
procedure
setErrorHandler(IErrorHandler)
function
getErrorHandler() : IErrorHandler
procedure
parse(IInputSource)
procedure
parse(SAXString)
function
resolveEntity(SAXString, SAXString) : IInputSource
procedure
notationDecl(PSAXChar, Integer, PSAXChar, Integer, PSAXChar, Integer)
procedure
unparsedEntityDecl(PSAXChar, Integer, PSAXChar, Integer, PSAXChar, Integer, PSAXChar, Integer)
procedure
setDocumentLocator(ILocator)
procedure
startDocument()
procedure
endDocument()
procedure
startPrefixMapping(PSAXChar, Integer, PSAXChar, Integer)
procedure
endPrefixMapping(PSAXChar, Integer)
procedure
startElement(PSAXChar, Integer, PSAXChar, Integer, PSAXChar, Integer, IBufferedAttributes)
procedure
endElement(PSAXChar, Integer, PSAXChar, Integer, PSAXChar, Integer)
procedure
characters(PSAXChar, Integer)
procedure
ignorableWhitespace(PSAXChar, Integer)
procedure
processingInstruction(PSAXChar, Integer, PSAXChar, Integer)
procedure
skippedEntity(PSAXChar, Integer)
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 : IBufferedXMLReader);
Set the parent reader.
This is the IBufferedXMLReader 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 : TBufferedXMLFilterImpl.getParent
Top
function getParent() : IBufferedXMLReader;
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 : TBufferedXMLFilterImpl.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, which is a fully-qualified URI.
Result : The current value of the feature (true or false).
Exception : ESAXNotRecognizedException If the feature
value can't be assigned or retrieved.
Exception : ESAXNotSupportedException When the
XMLReader 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, which is a fully-qualified URI.
Parameter : state The requested value of the feature (true or false).
Exception : ESAXNotRecognizedException If the feature
value can't be assigned or retrieved.
Exception : ESAXNotSupportedException When the
XMLReader 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, which is a fully-qualified URI.
Result : s An Interface that allows the getting and setting of the property
Exception : ESAXNotRecognizedException If the property
interface cannot be retrieved.
Exception : ESAXNotSupportedException When the
XMLReader recognizes the property name but
cannot determine its interface value at this time.
Top
procedure setEntityResolver(const resolver : IEntityResolver);
Set the entity resolver.
Parameter : resolver The entity resolver.
Top
function getEntityResolver() : IEntityResolver;
Get the current entity resolver.
Result : The current entity resolver, or nil if none
has been registered.
Top
procedure setDTDHandler(const handler : IBufferedDTDHandler);
Set the DTD event handler.
Parameter : handler The DTD handler.
Top
function getDTDHandler() : IBufferedDTDHandler;
Get the current DTD event handler.
Result : The current DTD handler, or null if none
has been registered.
Top
procedure setContentHandler(const handler : IBufferedContentHandler);
Set the content event handler.
Parameter : handler The content handler.
Top
function getContentHandler() : IBufferedContentHandler;
Get the content event handler.
Result : The current content handler, or nil if none
has been registered.
Top
procedure setErrorHandler(const handler : IErrorHandler);
Set the error event handler.
Parameter : handler The error handler.
Top
function getErrorHandler() : IErrorHandler;
Get the current error event handler.
Result : The current error handler, or nil if none
has been registered.
Top
procedure parse(const input : IInputSource);
Parse a document.
Parameter : source The input source for the top-level of the
XML document.
Exception : ESAXException Any SAX exception.
Exception : Exception An IO exception from the parser,
possibly from a byte stream
supplied by the application.
Top
procedure parse(const systemId : SAXString);
Parse a document.
Parameter : systemId The system identifier (URI).
Exception : ESAXException Any SAX exception.
Exception : Exception An IO exception from the parser,
possibly from a byte stream
supplied by the application.
Top
function resolveEntity(const publicId : SAXString; const systemId : SAXString) : IInputSource;
Filter an external entity resolution.
Parameter : publicId The public identifier of the external entity
being referenced, or empty if none was supplied.
Parameter : systemId The system identifier of the external entity
being referenced.
Result : An IInputSource interface describing the new input source,
or null to request that the parser open a regular
URI connection to the system identifier.
Exception : ESAXException Any SAX exception.
Exception : Exception A pascal-specific IO exception,
possibly the result of creating a new Stream
for the InputSource.
Top
procedure notationDecl( name : PSAXChar; nameLength : Integer; publicId : PSAXChar; publicIdLength : Integer; systemId : PSAXChar; systemIdLength : Integer);
Filter a notation declaration event.
Parameter : name The notation name.
Parameter : nameLength The length of the name buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : publicId The notation's public identifier, or empty if
none was given.
Parameter : publicIdLength The length of the publicId buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : systemId The notation's system identifier, or empty if
none was given.
Parameter : systemIdLength The length of the systemId buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Exception : ESAXException Any SAX exception.
Top
procedure unparsedEntityDecl( name : PSAXChar; nameLength : Integer; publicId : PSAXChar; publicIdLength : Integer; systemId : PSAXChar; systemIdLength : Integer; notationName : PSAXChar; notationNameLength : Integer);
Filter an unparsed entity declaration event.
Exception : ESAXException Any SAX exception.
Parameter : name The unparsed entity's name.
Parameter : nameLength The length of the name buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : publicId The entity's public identifier, or empty if none
was given.
Parameter : publicIdLength The length of the publicId buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : systemId The entity's system identifier.
Parameter : systemIdLength The length of the systemId buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : notationName The name of the associated notation.
Parameter : notationNameLength The length of the notationNameLength buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
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( prefix : PSAXChar; prefixLength : Integer; uri : PSAXChar; uriLength : Integer);
Filter a start Namespace prefix mapping event.
Parameter : prefix The Namespace prefix being declared.
An empty string is used for the default element namespace,
which has no prefix.
Parameter : prefixLength The length of the prefix buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : uri The Namespace URI the prefix is mapped to.
Parameter : uriLength The length of the uri buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Exception : ESAXException The client may throw
an exception during processing.
Top
procedure endPrefixMapping( prefix : PSAXChar; prefixLength : Integer);
Filter an end Namespace prefix mapping event.
Parameter : prefix The prefix that was being mapping.
Use the empty string when a default mapping scope ends.
Parameter : prefixLength The length of the prefix buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Exception : ESAXException The client may throw
an exception during processing.
Top
procedure startElement( uri : PSAXChar; uriLength : Integer; localName : PSAXChar; localNameLength : Integer; qName : PSAXChar; qNameLength : Integer; const atts : IBufferedAttributes);
Filter a start element event.
Parameter : uri The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.
Parameter : uriLength The length of the uri buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : localName The local name (without prefix), or the
empty string if Namespace processing is not being
performed.
Parameter : localNameLength The length of the localName buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : qName The qualified name (with prefix), or the
empty string if qualified names are not available.
Parameter : qNameLength The length of the qName buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : atts The attributes attached to the element. If
there are no attributes, it shall be an empty
IBufferedAttributes object or nil.
Exception : ESAXException Any SAX exception.
Top
procedure endElement( uri : PSAXChar; uriLength : Integer; localName : PSAXChar; localNameLength : Integer; qName : PSAXChar; qNameLength : Integer);
Filter an end element event.
Parameter : uri The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.
Parameter : uriLength The length of the uri buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : localName The local name (without prefix), or the
empty string if Namespace processing is not being
performed.
Parameter : localNameLength The length of the localName buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : qName The qualified name (with prefix), or the
empty string if qualified names are not available.
Parameter : qNameLength The length of the qName buffer.
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Top
procedure characters( ch : PSAXChar; length : Integer);
Filter a character data event.
Parameter : ch A pointer to a buffer of characters.
Parameter : length The number of characters to use from the buffer.
Exception : ESAXException The client may throw
an exception during processing.
Top
procedure ignorableWhitespace( ch : PSAXChar; length : Integer);
Filter an ignorable whitespace event.
Parameter : ch A pointer to a buffer of characters.
Parameter : length The number of characters to use from the array.
Exception : ESAXException The client may throw
an exception during processing.
Top
procedure processingInstruction( target : PSAXChar; targetLength : Integer; data : PSAXChar; dataLength : Integer);
Filter a processing instruction event.
Parameter : target The processing instruction target.
Parameter : targetLength The length of the target buffer
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Parameter : data The processing instruction data, or the empty string
if none was supplied. The data does not include any
whitespace separating it from the target.
Parameter : dataLength The length of the data buffer
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
Exception : ESAXException Any SAX exception.
Top
procedure skippedEntity( name : PSAXChar; nameLength : Integer);
Filter a skipped entity event.
Parameter : name The name of the skipped entity. If it is a
parameter entity, the name will begin with '%', and if
it is the external DTD subset, it will be the string
"[dtd]".
Parameter : nameLength The length of the name buffer
The value may be -1 which indicates that the buffer is
null-terminated. If the value is 0 then the buffer may be nil.
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