The XML SAX feature for Microsoft® Windows® CE operating system (OS) provides two co-classes that implement the XML Reader interface.
SAXXMLReader
The version-independent co-class. Uses the most current implementation. (CLSID_SAXXMLReader: 079aa557-4a18-424a-8eee-e39f0a8d41b9)
SAXXMLReader30
The version-dependent co-class. Ties the application to msxml3.dll. (CLSID_SAXXMLReader30: 3124c396-fb13-4836-a6ad-1317f1713688)
Registering Handlers
An application can set and query features in the reader, register event handlers for document processing, and initiate a document parse. With this COM implementation of Simple API for XML (SAX2) in C++, the reader can use the following methods to register the corresponding handlers.
| Method | Description |
|---|---|
| putContentHandler | Registers a content handler. |
| putDTDHandler | Registers a DTD handler. |
| putErrorHandler | Registers an error handler. |
Controlling Reader Behavior
You can use the following methods to observe and control the behavior of the reader.
| Method | Description |
|---|---|
| getFeature | Allows an application to ask the reader if it supports a feature. |
| putFeature | Allows an application to request that the reader turn a particular feature on or off. |
Supported Features and Properties
The Microsoft COM/C++ implementation of SAX2 supports the following features, for example, a property whose value is Boolean:
"http://xml.org/sax/features/namespaces""http://xml.org/sax/features/namespace-prefixes""http://xml.org/sax/features/external-general-entitities""http://xml.org/sax/features/external-parameter-entities""normalize-line-breaks""server-http-request"
The reader also provides the getProperty and putProperty methods for getting and putting these properties.
"http://xml.org/sax/properties/lexical-handler""http://xml.org/sax/properties/declaration-handler""xmldecl-encoding""xmldecl-version""xmldecl-standalone"
| Method | Description |
|---|---|
| getBaseURL | This method returns the base URL for the document. |
| putBaseURL | This method sets the base URL for the document. |
| getContentHandler | This method returns the current content handler. |
| putContentHandler | This method allows an application to register a content handler. |
| getDTDHandler | This method returns the current DTD handler. |
| putDTDHandler | This method allows an application to register a DTD handler. |
| getEntityResolver | This method returns the current entity resolver. At this time, the EntityResolver property cannot be set for this implementation of SAX2 (Simple API for XML). |
| putEntityResolver | This method allows an application to register an entity resolver. At this time, the EntityResolver property cannot be set for this implementation of SAX2 (Simple API for XML). |
| getErrorHandler | This method returns the current error handler. |
| putErrorHandler | This method allows an application to register an error handler. |
| getFeature | This method returns the Boolean value of a feature. |
| putFeature | This method sets the value of a feature. |
| getProperty | This method returns the value of a property. (Currently no properties are supported.) |
| putProperty | This method sets the value of a property. |
| getSecureBaseURL | This method returns the secure base URL for the document. |
| putSecureBaseURL | This method sets the secure base URL for the document. |
| parse | This method parses an XML document. |
| parseURL | This method parses an XML document from a system identifier. |
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.
Send Feedback on this topic to the authors