ISAXLexicalHandler

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

The ISAXLexicalHandler interface enables a Simple API for XML (SAX2) application to implement an optional extension handler for receiving information from the SAX2 reader, such as comments, the document type declaration, CDATA sections, and the start and end of an entity within a document. The events in the lexical handler apply to the entire document, not just to the document elements. Also note that all LexicalHandler events must appear between the content handler's ISAXContentHandler::startDocument Method and ISAXContentHandler::endDocument Method events.

To set the lexical handler for the reader, use the ISAXXMLReader::putProperty Method with the propertyId "https://xml.org/sax/properties/lexical-handler". The following code sample shows how to register the lexical handler.

... SAXXMLReader * r = ...
SAXLexicalHandler * lh = new SAXLexicalHandler ();
r->putProperty("https://xml.org/sax/properties/lexical-handler",lh);
Method Description

ISAXLexicalHandler::comment Method

This method receives XML comments from inside or outside the document element, including comments in the external document type definition (DTD) or schema subset.

ISAXLexicalHandler::endCDATA Method

This method receives the end of a character data (CDATA) section.

ISAXLexicalHandler::startCDATA Method

This method receives the beginning of a CDATA section.

ISAXLexicalHandler::endDTD Method

This method receives the end of a document type declaration.

ISAXLexicalHandler::startDTD Method

This method receives the beginning of a document type declaration.

ISAXLexicalHandler::endEntity Method

This method indicates that the reader has opened and finished processing an externally defined entity in the content of the document.

ISAXLexicalHandler::startEntity Method

This method indicates that the reader has opened and started to process an internally or externally defined entity in the content of the document.

Requirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

XML SAX Interfaces