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

Public Types | |
| enum | { kDefaultIID = IID_ISAXSERVICES } |
Public Member Functions | |
| virtual bool16 | ParseStream (IPMStream *stream, ISAXContentHandler *defaultHandler, ISAXEntityResolver *entityResolver=nil, ISAXDTDHandler *dtdHandler=nil, IXMLDTDTokenHandler *dtdTokenHandler=nil, BaseProgressBar *progressBar=nil)=0 |
| virtual ISAXContentHandler * | GetDefaultContentHandler () const =0 |
| virtual void | RegisterElementHandler (const WideString &uri, const WideString &localName, ISAXContentHandler *handler)=0 |
| virtual ISAXContentHandler * | QueryElementHandler (const WideString &uri, const WideString &localName) const =0 |
| virtual void | RegisterAttributeHandler (const WideString &uri, const WideString &localName, ISAXContentHandler *handler)=0 |
| virtual ISAXContentHandler * | QueryAttributeHandler (const WideString &uri, const WideString &localName) const =0 |
| virtual void | RegisterPIHandler (const WideString &targetName, ISAXContentHandler *handler)=0 |
| virtual ISAXContentHandler * | QueryPIHandler (const WideString &targetName) const =0 |
| virtual IXMLParsingContext * | QueryCurrentParsingContext ()=0 |
| virtual void | Push_Back (IXMLParsingContext *parsingContext)=0 |
| virtual IXMLParsingContext * | Pop_Back ()=0 |
| virtual IXMLParsingContext * | Back ()=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Class responsible for SAX parsing of an XML-based stream. Clients pass in custom handlers. SAX (Simple API for XML) specifies an abstract set of interfaces a conforming parser should implement; it is an example of an event based API for parsing XML. The contrast between an event-based API like SAX, versus DOM-based APIs, which construct in-memory parse trees, is described in some detail at the SAX Projects site.
InDesign constructs something akin to a DOM based representation of the logical structure of a document, using the services of the SAX based XML parser. One occasion where you may need to use this class from client code is to use IXMLStructureSuite::Import. You can construct an object supporting ISAXServices for use in these situations with code like this:
InterfacePtr<IK2ServiceRegistry> serviceRegistry(GetExecutionContextSession(), UseDefaultIID());
InterfacePtr<IK2ServiceProvider> xmlProvider(
serviceRegistry->QueryServiceProviderByClassID(kXMLParserService,
kXMLParserServiceBoss));
InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());
| pure virtual |
Peek at the parsing context information on the top of the stack. This does not remove the context information from the stack. Useful for examining parent information.
| pure virtual |
Return the default content handler that was supplied at the beginning of the parse. This is only valid during a parse. Otherwise this will return nil.
| pure virtual |
Parse the XML data in the incoming stream, calling out to the DocumentHandler as elements are encountered.
| stream | specifies the stream containing the XML content to parse |
| progressBar | the progress bar to use when importing XML content. |
| pure virtual |
Remove the specified set of parsing context information on a stack.
| pure virtual |
Save the specified set of parsing context information on a stack. When parsing an imported XML file parent/child element parsing information is maintained on this stack. For example StartElement pushes the current parsing context information on the stack before creating a new element.
| parsingContext | a set of parsing context information, usually the current information. |
| pure virtual |
Return the content handler registered for this attribute.
| uri | the uri (namespace) of the attribute |
| localName | the unqualifed portion of the attribute |
| pure virtual |
Returns the current parsing context information. This includes the current element, tag name, child index, story reference, and text insertion position. Additional parsing context information can be accessed via this interface if content handlers have data interfaces to kXMLParsingLocatorBoss.
| pure virtual |
Return the content handler registered for this element tag name.
| uri | the uri (namespace) of the tag name |
| localName | the unqualifed portion of the tag name |
| pure virtual |
Return the content handler registered for this processing instruction target name.
| targetName | the name of the target |
| pure virtual |
Register a content handler for a given attribute. When the parser encounters an element with the specified attribute it will use this content handler to deal with it.
| uri | the uri (namespace) of the attribute |
| localName | the unqualifed portion of the attribute |
| handler | an instance of ISAXContentHandler that handle this element |
| pure virtual |
Register a content handler for a given element. When the parser encounters an element with the specified name it will use this content handler to deal with it.
| uri | the uri (namespace) of the tag name |
| localName | the unqualifed portion of the tag name |
| handler | an instance of ISAXContentHandler that handle this element |
| pure virtual |
Register a content handler for a given processing instruction target. When the parser encounters a PI with the specified target name it will use this content handler to deal with it.
| targetName | the name of the processing instruction target |
| handler | an instance of ISAXContentHandler that handle this PI |