InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ISAXDOMSerializerHandler Class Referenceabstract

#include <ISAXDOMSerializerHandler.h>

Inheritance diagram for ISAXDOMSerializerHandler:
IPMUnknownCPMUnknown< ISAXDOMSerializerHandler >CSAXDOMSerializerHandlerDataUpdaterDOMSerializerHandlerXDocBkCALSContentHandler

Public Types

enum  { kDefaultIID = IID_ISAXDOMSERIALIZERHANDLER }
 

Public Member Functions

virtual void Register (ISAXDOMSerializerServices *saxServices, IPMUnknown *importer=nil)=0
 
virtual void Characters (const WideString &chars, IIDXMLDOMNode *currentNode)=0
 
virtual void StartDocument (ISAXDOMSerializerServices *saxServices)=0
 
virtual void EndDocument ()=0
 
virtual void StartElement (const WideString &uri, const WideString &localname, const WideString &qname, ISAXAttributeList *attrList, IIDXMLDOMNode *currentNode)=0
 
virtual void EndElement (const WideString &uri, const WideString &localname, const WideString &qname, IIDXMLDOMNode *currentNode)=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 ProcessingInstruction (const WideString &target, const WideString &data, IIDXMLDOMNode *currentNode)=0
 
virtual void ExtComment (const WideString &comment, IIDXMLDOMNode *currentNode)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface provides an InDesign friendly interface to the AXE (xerces) DOM serializer handler. It receives notification of document events as an AXE DOM is traversed. This interface is based upon ISAXContentHandler but is a subset of that interface.

See Also
ISAXContentHandler

This interface provides the contents of an AXE DOM in an ordered series of events. The client can put that information to use in a variety of ways such as serializing the contents to disk or incorporating the contents into their own document structure.

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.

A pointer to IIDXMLDOMNode is supplied to pertinent methods so that an application can obtain any attached private client data.

Important: This handler can be used with a single DOM traversal only. A new handler should be constructed for such traversal.

Member Function Documentation

virtual void ISAXDOMSerializerHandler::Characters (const WideStringchars,
IIDXMLDOMNodecurrentNode 
)
pure virtual

Receives character data

This method is called to report each chunk of character data. Contiguous character data is reported in a single chunk, or it may be split it into several chunks. But all characters in any single event must come from the same external entity.

The ignorableWhitespace() method is not implemented on this interface so all character data in the AXE DOM will be reported by this method.

Parameters
charsThe characters from the XML document.
currentNodeThe node that contained this data. It is only passed for access to any private client data.

Implemented in XDocBkCALSContentHandler, DataUpdaterDOMSerializerHandler, and CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::EndDocument ()
pure virtual

Receive end of document notification

This method only once and it will be the last method invoked during the traversal.

Implemented in CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::EndElement (const WideStringuri,
const WideStringlocalname,
const WideStringqname,
IIDXMLDOMNodecurrentNode 
)
pure virtual

Receive end of element notification

This method will be invoked 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).

Parameters
uriThe URI of the associated namespace for this element
localnameThe local part of the element name
qnameThe QName of this element
currentNodeThe same node passed to startElement.

Implemented in XDocBkCALSContentHandler, DataUpdaterDOMSerializerHandler, and CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::EndPrefixMapping (const WideStringprefix)
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.

Parameters
prefixThe namespace prefix used

Implemented in CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::ExtComment (const WideStringcomment,
IIDXMLDOMNodecurrentNode 
)
pure virtual

(Extension) Receive a comment

This method will be invoked when the traveral encounters a comment.

Parameters
commentThe interior text of the comment.
currentNodeThe node that contained this data. It is only passed for access to any private client data.

Implemented in CSAXDOMSerializerHandler.

virtual bool16 ISAXDOMSerializerHandler::HandlesSubElements () const
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.

Returns
true if this handler will handle subelements, false if doesn't handle subelements

Implemented in XDocBkCALSContentHandler, DataUpdaterDOMSerializerHandler, and CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::ProcessingInstruction (const WideStringtarget,
const WideStringdata,
IIDXMLDOMNodecurrentNode 
)
pure virtual

Receive a processing instruction

This method will be invoked once for each processing instruction found: note that processing instructions may occur before or after the root element.

Parameters
targetThe processing instruction target
dataThe processing instruction data, or null if none was supplied
currentNodeThe node that contained this data. It is only passed for access to any private client data.

Implemented in CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::Register (ISAXDOMSerializerServicessaxServices,
IPMUnknownimporter = nil 
)
pure virtual

Register this handler to handle specific elements, attributes, and processing instructions.

When combined with a service provider implementation SAXDOMSerializerServices will call your Register method to allow the serializer handler to specify which elements, attributes, and/or processing instructions it is interested in handling. Registration is accomplished by calling RegisterElementHandler, RegisterAttributeHandler, and RegisterPIHandler.

Parameters
saxServicesThe instance of ISAXDOMSerializerServices instantiated for this DOM serialization.
importerThe instance of XMLImporter being used for this DOM serialization. The Handler needs to be able to get to the IMatchRecorder and IXMLImporterDOM from the interface passed in here.

Implemented in XDocBkCALSContentHandler, DataUpdaterDOMSerializerHandler, and CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::StartDocument (ISAXDOMSerializerServicessaxServices)
pure virtual

Receive the beginning of document notification

This method will be invoked once before other methods in this interface.

NOTE: Do NOT throw exceptions from this function.

Parameters
saxServicesThe instance of ISAXDOMSerializerServices instantiated for this DOM serialization.

Implemented in CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::StartElement (const WideStringuri,
const WideStringlocalname,
const WideStringqname,
ISAXAttributeListattrList,
IIDXMLDOMNodecurrentNode 
)
pure virtual

Receive the beginning of element notification

This method will be invoked 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.

Parameters
uriThe URI of the associated namespace for this element
localnameThe local part of the element name
qnameThe QName of this element
attrListThe attributes attached to the element, if any.
currentNodeThe node that contained this data. It is passed for access to the attribute value tree so that a client can determine if any entities were used to construct the attribute value. It can also be used to retrieve any private client data.
See Also
EndElement
ISAXAttributeList

Implemented in XDocBkCALSContentHandler, DataUpdaterDOMSerializerHandler, and CSAXDOMSerializerHandler.

virtual void ISAXDOMSerializerHandler::StartPrefixMapping (const WideStringprefix,
const WideStringuri 
)
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.

Parameters
prefixThe namespace prefix used
uriThe namespace URI used.

Implemented in CSAXDOMSerializerHandler.