![]() | InDesign SDK 20.5 |
#include <ISaxContentHandler.h>

Public Types | |
| enum | { kDefaultIID = IID_ISAXCONTENTHANDLER } |
Public Member Functions | |
| virtual void | Register (ISAXServices *saxServices, IPMUnknown *importer=nil)=0 |
| virtual void | Characters (const WideString &chars)=0 |
| virtual void | StartDocument (ISAXServices *saxServices)=0 |
| virtual void | EndDocument ()=0 |
| virtual void | StartElement (const WideString &uri, const WideString &localname, const WideString &qname, ISAXAttributes *attrs)=0 |
| virtual void | EndElement (const WideString &uri, const WideString &localname, const WideString &qname)=0 |
| virtual bool16 | HandlesSubElements () const =0 |
| virtual void | StartPrefixMapping (const WideString &prefix, const WideString &uri)=0 |
| virtual void | EndPrefixMapping (const WideString &prefix)=0 |
| virtual void | IgnorableWhitespace (const WideString &chars)=0 |
| virtual void | ProcessingInstruction (const WideString &target, const WideString &data)=0 |
| virtual void | SkippedEntity (const WideString &name)=0 |
| virtual void | ExtComment (const WideString &comment)=0 |
| virtual void | ExtXMLDecl (const WideString &version, const WideString &encoding, const WideString &standalone, const WideString &actualEncoding)=0 |
| virtual void | SetDocumentLocator (ISAXLocator *locator)=0 |
| virtual ISAXLocator * | GetDocumentLocator () const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Wrapper for HAXEContentHandlerBase. Receives notification of general document events.
This is the main interface that most applications implement for parsing of XML files. It provides an InDesign friendly interface to the AXE (xerces) XML parser. If the application needs to be informed of basic parsing events, it provides an implementation of this interface and passes it to ISAXServices::ParseStream. Additional paramaters are specified via specific data interfaces. The parser uses the instance to report basic document-related events like the start and end of elements and character data.
The order of events in this interface is very important because it mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and/or subelements) will appear, in order, between the StartElement event and the corresponding EndElement event.
| pure virtual |
Receives character data
The parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks. But all characters in any single event must come from the same external entity so the Locator provides useful information.
Note some parsers will report whitespace using the IgnorableWhitespace() method rather than this one (validating parsers must do so).
| Chars | The characters from the XML document. |
Implemented in XCatHndSAXContentHandler, CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
Receive end of document notification
The SAX parser will invoke this method only once and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
Receive end of element notification
The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement() event for every endElement() event (even when the element is empty).
| uri | The URI of the associated namespace for this element |
| localname | The local part of the element name |
| qname | The QName of this element |
Implemented in XCatHndSAXContentHandler, BasePanelSAXHandler, CHLUserDictContentHandler, CSAXContentHandler, and DCLSizPanelSAXHandler.
| pure virtual |
Receive end of namespace prefix mapping notification
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each namespace prefix mapping.
| prefix | The namespace prefix used |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
(Extension) Receive a comment
The parser will invoke this method when it encounters a comment.
| comment | The interior text of the comment. |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
(Extension) Receive the XML declaration
The parser will invoke this method when it encounters a well-formed XML declaration. Any or all of these strings may be invalid, so check first before using them.
| version | The XML version |
| encoding | The encoding specified in the declaration |
| standalone | The value of the standalone indicator. |
| actualEncoding | The actual encoding detected by the parser |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
return a parser position locator
This is the document locator that was set before an parsing began
Implemented in CSAXContentHandler.
| pure virtual |
When this handler is registered to handle an element with a specific tagname, the handler can decide if it wants to handle any subelements of that element that don't have a handler for themselves. If true is returned, any elements that are child elements without their own ISAXContentHandler will cause StartElement() to be called on this handler. If, however, false is returned, next handler on the stack will be called with HandlesSubElements() until one returns tru or we get to the default handler.
Implemented in XCatHndSAXContentHandler, BasePanelSAXHandler, CSAXContentHandler, and DCLSizPanelSAXHandler.
| pure virtual |
Receive ignorable whitespace in element content
Validating parsers must use this method to report each chunk of ignorable whitespace (see the W3C XML 1.0 recommendation, section 2.10). Non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks. But all characters in any single event must come from the same external entity so the Locator provides useful information.
| chars | The characters from the XML document. |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
Receive a processing instruction
The parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a text declaration (XML 1.0, section 4.3.1) using this method.
| target | The processing instruction target |
| data | The processing instruction data, or null if none was supplied |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
Register this content handler to handle specific elements, attributes, and processing instructions.
When combined with a service provider implementation SAXServices will call your Register method to allow the content handler to specify which elements, attributes, and/or processing instructions it is interested in handling. Registration is accomplished by calling RegisterElementHandler, RegisterAttributeHandler, and RegisterPIHandler.
| saxServices | The instance of ISAXServices instantiated for this parse. |
| importer | The instance of XMLImporter being used for this import. The Content Handler needs to be able to get to the IMatchRecorder and IXMLImporterDOM from the interface passed in here. |
Implemented in XCatHndSAXContentHandler, BasePanelSAXHandler, CSAXContentHandler, and DCLSizPanelSAXHandler.
| pure virtual |
Receive a parser position locator
If this method is called at all, it is guaranteed to be called before invoking any of the other methods in this interface.
The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during each individual call to the functions in this interface. The application should not attempt to use it at any other time.
| locator | An object that can return the location of any SAX document event. |
Implemented in CSAXContentHandler.
| pure virtual |
Receive a skipped entity notification
The parser will invoke this method once for each entity skipped. All processors may skip external entities, depending on the values of the features:
http://xml.org/sax/features/external-general-entities
http://xml.org/sax/features/external-parameter-entities
| 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]. |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
Receive the beginning of document notification
The SAX parser will invoke this method once before other methods in this interface or in DTDHandler (except for setDocumentLocator).
| saxServices | The instance of ISAXServices instantiated for this parse. |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.
| pure virtual |
Receive the beginning of element notification
The parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement() event for every startElement() event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement() event.
Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted.
| uri | The URI of the asscioated namespace for this element |
| localname | The local part of the element name |
| qname | The QName of this element |
| attrs | The attributes attached to the element, if any. |
Implemented in XCatHndSAXContentHandler, CHLUserDictContentHandler, BasePanelSAXHandler, CSAXContentHandler, and DCLSizPanelSAXHandler.
| pure virtual |
Receive start of namespace prefix mapping notification
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each namespace prefix mapping.
| prefix | The namespace prefix used |
| uri | The namespace URI used. |
Implemented in CHLUserDictContentHandler, and CSAXContentHandler.