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

#include <IDOMServices.h>

Inheritance diagram for IDOMServices:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDOMSERVICES }
 

Public Member Functions

virtual IIDXMLDOMDocumentParse (IPMStream *stream, ISAXEntityResolver *entityResolver=nil, IXMLDTDTokenHandler *dtdTokenHandler=nil, BaseProgressBar *progressBar=nil)=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

A DOM-generating parser

This API should be used by applications wishing to parse XML files to generate a DOM tree. One instance of this object should be created for each XML document to be parsed.

Each IDOMServices object maintains a reference to the IIDXMLDOMDocument generated by parsing XML. Hanging on to the IDOMServices instance is one way to keep the DOM tree alive. Releasing the IDOMServices will reduce the reference count on the document by one. If the IDOMServices instance is the last reference, the document will be deleted, and all memory allocated to the DOM tree will be recovered.

Invalid Parameters

Unless otherwise indicated, it is an error to use an invalid container (IsValid() == false), or a NULL pointer, as a parameter to any function. In some instances, the requirement that a specific parameter must be valid is repeated in the commentary for the specific function. The lack of any indication in the commentary for the specific function should still be taken to mean that an invalid container or NULL pointer will result in a kAXEErrClientFault exception.

Member Function Documentation

virtual IIDXMLDOMDocument* IDOMServices::Parse (IPMStreamstream,
ISAXEntityResolverentityResolver = nil,
IXMLDTDTokenHandler * dtdTokenHandler = nil,
BaseProgressBarprogressBar = nil 
)
pure virtual

Parse any XML document

The application can use this method to instruct the DOM parser to begin parsing an XML document from a client defined stream. This function returns when the XML file is completely parsed, or when an error or fatal error occurs.

Applications may not invoke this method while a parse is in progress (they should create a new parser instead for each additional XML document).

Parameters
streamThe input stream for the top-level of the XML document.
entityResolverRequired if the client needs to resolve external entities.
dtdTokenHandlerThe handler that handles DTD callbacks during XML DTD parsing.
progressBarThe progress bar to use during the parse.
Returns
The IIDXMLDOMDocument object that represents the entire XML document. Nil will be returned if there is no tree yet.