This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.
XMLReader is the interface that an XML parser's SAX2 driver must implement. This interface allows an application to set and query features and properties in the parser, to register event handlers for document processing, and to initiate a document parse.
All SAX interfaces are assumed to be synchronous: the parse methods must not return until parsing is complete, and readers must wait for an event-handler callback to return before reporting the next event.
This interface replaces the (now deprecated) SAX 1.0 IParser interface. The XMLReader interface contains two important enhancements over the old Parser interface (as well as some minor ones):
There are adapters available to convert a SAX1 Parser to a SAX2 XMLReader and vice-versa.
For reasons of generality and efficiency, strings that are returned from the interface are declared as pointers (PSAXChar) and lengths. This requires that the model use procedural out parameters rather than functions as in the original interfaces.
procedure setDTDHandler(const handler : IBufferedDTDHandler);
Allow an application to register a DTD event handler.If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
function getDTDHandler() : IBufferedDTDHandler;
Return the current DTD handler.procedure setContentHandler(const handler : IBufferedContentHandler);
Allow an application to register a content event handler.If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
function getContentHandler() : IBufferedContentHandler;
Return the current content handler.ContentHandler
Extension property to get and set the ContentHandler
property ContentHandler: IBufferedContentHandler
read getContentHandler write setContentHandler
DTDHandler
Extension property to get and set the DTDHandler
property DTDHandler: IBufferedDTDHandler
read getDTDHandler write setDTDHandler