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

#include <IIDXMLDOMDocument.h>

Public Member Functions

virtual IIDXMLDOMNodeGetDocumentNode () const =0
 
virtual IIDXMLDOMNodeGetRootNode () const =0
 
virtual IIDXMLDOMNodeImportNode (IIDXMLDOMNode *toImport, bool16 deepImport)=0
 
virtual IIDXMLDOMNodeCreateElementNode (const WideString &namespaceURI, const WideString &qName)=0
 
virtual IIDXMLDOMNodeCreateCommentNode (const WideString &comment)=0
 
virtual IIDXMLDOMNodeCreatePINode (const WideString &target, const WideString &value)=0
 
virtual IIDXMLDOMNodeCreateTextNode (const WideString &text)=0
 
virtual IIDXMLDOMNodeCreateAttribute (const WideString &namespaceURI, const WideString &qName, const WideString &value)=0
 
virtual int32 GetDOMElementCount () const =0
 
virtual void SetDOMElementCount (int32 elementCount)=0
 
virtual bool16 operator== (const IIDXMLDOMDocument *other)=0
 
virtual void Serialize (ISAXDOMSerializerServices *owner, ISAXDOMSerializerHandler *defaultHandler, BaseProgressBar *progressBar, bool16 allowProviders)=0
 
virtual
BIB_NAMESPACE::CAXEDocumentDOM 
GetAXEObject ()=0
 
virtual void SetAXEObject (BIB_NAMESPACE::CAXEDocumentDOM newObj)=0
 

Detailed Description

Document Node

Conceptually, a DOM document node is the root of the document tree, and provides the primary access to the document's data. The IIDXMLDOMDocument class wraps the CAXEDocumentDOM class which follows the rules specified by the W3C DOM Core Level 2 specification.

Memory Management

Unless otherwise stated pointers returned by methods in this class are owned by the class and not the client. Exceptions to this rule will be stated clearly where they apply.

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 IIDXMLDOMNode* IIDXMLDOMDocument::CreateAttribute (const WideStringnamespaceURI,
const WideStringqName,
const WideStringvalue 
)
pure virtual

Create attribute in namespace

Create an attribute with the given qualified name in the given namespace. The prefix part of the qualified name is assumed to be mapped to the specified namespace.

The prefix and local name are extracted from the 'qName'.

The client owns this pointer you must either pass it to another object which will take ownership or delete it yourself

Parameters
namespaceURIThe namespace URI of the attribute
qNameThe qualified name of the attribute
Returns
A new IIDXMLDOMNode pointer. Remember you own this pointer. You must either delete it or pass it to IIDXMLDOMNode::InsertBefore()
See Also
IIDXMLDOMNode
virtual IIDXMLDOMNode* IIDXMLDOMDocument::CreateCommentNode (const WideStringcomment)
pure virtual

Create a comment

The client owns this pointer you must either pass it to another object which will take ownership or delete it yourself

Parameters
commentThe text in the comment
Returns
A new IIDXMLDOMNode pointer. Remember you own this pointer. You must either delete it or pass it to IIDXMLDOMNode::InsertBefore()
See Also
IIDXMLDOMNode
virtual IIDXMLDOMNode* IIDXMLDOMDocument::CreateElementNode (const WideStringnamespaceURI,
const WideStringqName 
)
pure virtual

Create element in namespace

Create an element with the given qualified name in the given namespace. The prefix part of the qualified name is assumed to be mapped to the specified namespace.

The prefix and local name are extracted from the 'qName'.

The client owns this pointer you must either pass it to another object which will take ownership or delete it yourself

Parameters
namespaceURIThe namespace URI of the attribute
qNameThe qualified name of the attribute
Returns
A new IIDXMLDOMNode pointer. Remember you own this pointer. You must either delete it or pass it to IIDXMLDOMNode::InsertBefore()
See Also
IIDXMLDOMNode
virtual IIDXMLDOMNode* IIDXMLDOMDocument::CreatePINode (const WideStringtarget,
const WideStringvalue 
)
pure virtual

Create a processing instruction

The client owns this pointer you must either pass it to another object which will take ownership or delete it yourself

Parameters
targetThe target for the PI
valueThe value for the PI
Returns
A new IIDXMLDOMNode pointer. Remember you own this pointer. You must either delete it or pass it to IIDXMLDOMNode::InsertBefore()
See Also
IIDXMLDOMNode
virtual IIDXMLDOMNode* IIDXMLDOMDocument::CreateTextNode (const WideStringtext)
pure virtual

Create a text node

The client owns this pointer you must either pass it to another object which will take ownership or delete it yourself

Parameters
textThe text to be inserted into the DOM
Returns
A new IIDXMLDOMNode pointer. Remember you own this pointer. You must either delete it or pass it to IIDXMLDOMNode::InsertBefore()
See Also
IIDXMLDOMNode
virtual BIB_NAMESPACE::CAXEDocumentDOM IIDXMLDOMDocument::GetAXEObject ()
pure virtual

For internal use only.

virtual IIDXMLDOMNode* IIDXMLDOMDocument::GetDocumentNode () const
pure virtual

Returns the document level node. This is one level up from the root node because it can contain other items (PIs, comments, etc)

Returns
- A pointer to the document node. Nil will be return if the DocumentDOM is not valid.
virtual int32 IIDXMLDOMDocument::GetDOMElementCount () const
pure virtual

Get the number of elements in this DOM

Returns
The number of elements in this DOM
virtual IIDXMLDOMNode* IIDXMLDOMDocument::GetRootNode () const
pure virtual

Returns the root node

Returns
- A pointer to the root node
virtual IIDXMLDOMNode* IIDXMLDOMDocument::ImportNode (IIDXMLDOMNodetoImport,
bool16 deepImport 
)
pure virtual

Import nodes from another document

Imports a node from another document to this document. The returned node has no parent (parentNode is null), with the expectation that the client will insert it somewhere in the current document's tree. The source node is not altered or removed from the original document; this method creates a new copy of the source node. For all nodes, importing a node creates a node object owned by the importing document, with DOM IDL attribute values identical to the source node's nodeName and nodeType, plus the DOM IDL attributes related to namespaces (prefix and namespaces URI).

See the W3C DOM specification for the details on how each of the node types is handled during import.

DOM Level 2

Parameters
toImportThe node to import.
deepImportIf 'kTrue', recursively import the subtree under the specified node; if kFalse, import only the node itself, as explained above. See the W3C DOM specification for a detailed discussion of the impact and relevance of the 'deep' parameter on various node types.
Returns
The imported node that belongs to this Document.
virtual void IIDXMLDOMDocument::Serialize (ISAXDOMSerializerServicesowner,
ISAXDOMSerializerHandlerdefaultHandler,
BaseProgressBarprogressBar,
bool16 allowProviders 
)
pure virtual

Serialize a Document. For internal use only.

The document DOM will be serialized through a series of SAX-like messages to the client's implementation of the HAXEDOMSerializerHandlerBase class.

Parameters
ownerThe SAXDOMSerializerServices that starts the serialization.
defaultHandlerThe default handler to hanlder meesages during the serialization.
progressBarThe progress bar to be checked and updated while serializing the DOM
allowProvidersSpecifies whether to search customized handlers before using the default handler.
virtual void IIDXMLDOMDocument::SetDOMElementCount (int32 elementCount)
pure virtual

For internal use only. Set the pre-computed number of elements in the DOM. This is an optimization, so that when we call GetDOMElementCount, we don't have to iterate through all the nodes counting.

Parameters
elementCountThe number of elements in this DOM