![]() | InDesign SDK 20.5 |
#include <IIDXMLDOMNode.h>
Public Types | |
| enum | kNodeTypes { kElement, kDocument, kText, kProcessingInstruction, kAttribute, kComment, kUnknown } |
Public Member Functions | |
| virtual IIDXMLDOMNode * | CloneNode (bool deepClone)=0 |
| virtual bool16 | IsValid () const =0 |
| virtual IIDXMLDOMNode::kNodeTypes | GetNodeType () const =0 |
| virtual bool16 | GetLocalName (WideString &localName) const =0 |
| virtual bool16 | GetNamespaceURI (WideString &namespaceURI) const =0 |
| virtual bool16 | GetNodeName (WideString &name) const =0 |
| virtual bool16 | GetNodeValue (WideString &value) const =0 |
| virtual void | SetNodeValue (const WideString &val)=0 |
| virtual bool16 | GetPrefix (WideString &prefix) const =0 |
| virtual void | SetPrefix (const WideString &prefix)=0 |
| virtual IIDXMLDOMNamedNodeMap * | GetAttributes () const =0 |
| virtual bool16 | HasChildNodes () const =0 |
| virtual IIDXMLDOMNList * | GetChildNodes () const =0 |
| virtual IIDXMLDOMNode * | GetFirstChild () const =0 |
| virtual IIDXMLDOMNode * | GetLastChild () const =0 |
| virtual IIDXMLDOMNode * | GetNextSibling () const =0 |
| virtual IIDXMLDOMNode * | GetPreviousSibling () const =0 |
| virtual IIDXMLDOMNode * | GetParentNode () const =0 |
| virtual IIDXMLDOMDocument * | GetOwnerDocument () const =0 |
| virtual void | InsertBefore (IIDXMLDOMNode *newNode, IIDXMLDOMNode *whichNode)=0 |
| virtual void | AppendChild (IIDXMLDOMNode *newChild)=0 |
| virtual void | ReplaceChild (IIDXMLDOMNode *newChild, IIDXMLDOMNode *oldChild)=0 |
| virtual IIDXMLDOMNode * | RemoveChild (IIDXMLDOMNode *oldChild)=0 |
| virtual BIB_NAMESPACE::CAXENodeDOM | GetAXEObject ()=0 |
DOM Node
Conceptually, a DOM Node is any type of object in a DOM Tree rather than just an element. This includes (elements, attributes, processing instructions, comments, text, etc)
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.
| pure virtual |
Append child node
Adds the node 'newChild' to the end of the list of children of this node.
If the 'newChild' is already in the tree, it is first removed.
| newChild | The node to add. It must be a node owned by the same document as this node. |
| pure virtual |
Clone a node and optionally clone its descendants
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 document; this method creates a new copy of the source node. For all nodes, cloning a node creates a node object owned by the owning 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.
Note: You own the pointer to this node and must either insert it into the document or delete it yourself.
DOM Level 2
| deepClone | If 'kTrue', recursively clone the subtree under the specified node; if kFalse, clone only the node itself, as explained above. See the W3C DOM specification for a detailed discussion of the clone and relevance of the 'deepClone' parameter on various node types. |
| pure virtual |
Get attributes
Get attributes from a kElement node. For any other type of node this function returns nil.
| pure virtual |
For internal use only.
| pure virtual |
List of child nodes
If there are no children, this is a node list containing no nodes. The content of the returned node list is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the node list accessors; it is not a static snapshot of the content of the node.
For node types that do not have children, a list of zero length is returned. Note that a zero length node list will not keep the DOM tree alive if all other references to that tree are destroyed.
| pure virtual |
First child node
Get the first child node. Not all node types have children.
| pure virtual |
Last child node
Get the last child node. Not all node types have children.
| pure virtual |
Local part of qualified name
Get the local part of the qualified name given to this node. Not all node types can have a qualified name. If no qualification was ever specified, this function returns false. The prefix and local part of a qualified name are always stored separately, though the combined qualified name is available through GetNodeName.
| localName | An output parameter that is assigned with the local part of the qualified name if it exists, otherwise it is left unchanged. |
| pure virtual |
Namespace URI
WARNING: This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other than kElement and kAttribute and nodes created with a DOM Level 1 method, such as CreateElement from the IIDXMLDOMDocument interface, this always returns false.
| namespaceURI | An output parameter that is assigned with the namespace URI if it exists, otherwise it is left unchanged. |
| pure virtual |
Next sibling node
Get the sibling that follows this one in document order. Not all node types have siblings.
| pure virtual |
Node name
Get the node name. Not all node types have names. Comments will have names and the target of a PI is given by the name property
| name | An output parameter that is assigned the node name if this function returns 'true', left unchanged otherwise. |
| pure virtual |
Node type
Get the node type. To allow for possible additions in the future, the type is an integer value, selected from the constants enumerated as kNodeTypes.
| pure virtual |
Node value
Get the node value. Not all node types have values. Comments will have their data stored in the value.
| val | An output parameter that is assigned the node value if this function returns 'true', left unchanged otherwise. |
| pure virtual |
Parent node
All nodes, except kDocument and kAttribute may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, nil is returned.
| pure virtual |
Prefix of qualified name
Get the prefix of the qualified name given to this node. Not all node types can have a qualified name. If no qualification was ever specified, this function returns false. The prefix and local part of a qualified name are always stored separately, though the combined qualified name is available through GetNodeName.
| prefix | An output parameter that is assigned with the prefix of the qualified name if it exists, otherwise it is left unchanged. |
| pure virtual |
Previous sibling node
Get the sibling that preceeds this one in document order. Not all node types have siblings.
| pure virtual |
Node has children?
This is a convenience method to allow easy determination of whether a node has any children.
| pure virtual |
Insert node before
Inserts the node 'newChild' before the existing child node 'refChild', or at the end of the list of children if refChild is nil.
If newChild is already in the tree, it is first removed.
| newChild | The node to insert. It must be a node owned by the same document as this node. |
| refChild | The reference node, i.e., the node before which the new node must be inserted. May be invalid. If not invalid, must be a current child of this node. |
| pure virtual |
Is Valid Is this node in a valid state
| pure virtual |
Replace child node
Replaces the child node 'oldChild' with 'newChild' in the list of children.
If the newChild is already in the tree, it is first removed.
| newChild | The new node to put in the child list. It must be a node owned by the same document as this node. |
| oldChild | The node being replaced in the list. Must be a current child of this node. |
| pure virtual |
Set node value
Any node which can have a nodeValue (
For most types of node, value is null and attempting to set it will result in an error. This will also be the result if the node is read-only.
| val | The value to set the node to. |
| pure virtual |
Set prefix of qualified name
Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the an element or attribute interface, when applicable.
| prefix | The prefix to set. |