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

Public Types | |
| enum | { kDefaultIID = IID_IXMLACCESS } |
Public Member Functions | |
| virtual void | VisitAllElements (IIDXMLElement *rootElement, IXMLHandler *handler)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Contains utilities for navigating and operating on the XML structure tree. Based around the Visitor pattern.
One way to implement an operation that involves objects in a complex structure is to provide logic in each of their classes to support the operation.
The Visitor pattern provides an alternative way to implement such operations that avoids complicating the classes of the objects in the structure by putting all of the necessary logic in a separate visitor class. The Visitor pattern also allows the logic to be varied by using different visitor classes.
It can be regarded as a generalisation of the Iterator pattern; The Iterator pattern is an alternative to the Visitor pattern when the object structure to be navigated has a linear structure; for instance, Iterator is used in IIDXMLElement to traverse only the children. Here we're interested in the entire sub-tree of dependents.
| pure virtual |
This method does the traverse of the subtree of the logical structure starting from rootElement. The methods on the handler (type IXMLHandler) will get called in sequence; every time an element (IIDXMLElement) gets visited, the same sequence of method calls will be sent out to the handler
| rootElement | where to start traversing the tree from |
| handler | specifies the entity that will receive 'callbacks' (method calls on IXMLHandler) as each element is visited |