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

#include <IIDXMLDOMNamedNodeMap.h>

Public Member Functions

 IIDXMLDOMNamedNodeMap (const BIB_NAMESPACE::CAXENamedNodeMapDOM &)
 
virtual int32 Length () const =0
 
virtual IIDXMLDOMNodeGetNthNode (int32 which)=0
 
virtual IIDXMLDOMNodeGetNamedItem (const WideString &name)=0
 
virtual IIDXMLDOMNodeGetNamedItemNS (const WideString &namespaceURI, const WideString &localName)=0
 
virtual IIDXMLDOMNodeRemoveNamedItem (const WideString &name)=0
 
virtual IIDXMLDOMNodeRemoveNamedItemNS (const WideString &namespaceURI, const WideString &localName)=0
 
virtual IIDXMLDOMNodeSetNamedItem (IIDXMLDOMNode *newNode)=0
 
virtual IIDXMLDOMNodeSetNamedItemNS (IIDXMLDOMNode *newNode)=0
 

Detailed Description

A map of named nodes

IIDXMLDOMNamedNodeMaps are used to represent collections of nodes that can be accessed by name.

Note that IIDXMLDOMNamedNodeMap does not inherit from IIDXMLDOMNList; IIDXMLDOMNamedNodeMaps are not maintained in any particular order. Nodes contained in a IIDXMLDOMNamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents, and does not imply that the DOM specifies an order to these Nodes.

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 an error.

Member Function Documentation

virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::GetNamedItem (const WideStringname)
pure virtual

Get node by name

Parameters
nameThe nodeName of a node to retrieve.
Returns
Returns a pointer to the specified item. Nil is returned if the item wasn't found
virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::GetNamedItemNS (const WideStringnamespaceURI,
const WideStringlocalName 
)
pure virtual

Get node by local name and namespace URI

Parameters
namespaceURIThe namespace URI of the node to retrieve.
localNameThe local part of the node to retrieve.
Returns
Returns a pointer to the specified item. Nil is returned if the item wasn't found
virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::GetNthNode (int32 which)
pure virtual

Returns an item in the map

If 'which' is greater than or equal to the number of nodes in the map, returns nil.

Parameters
whichIndex into the list, starting with 0.
Returns
Returns a pointer to the specified item. Nil is returned if the item wasn't found
virtual int32 IIDXMLDOMNamedNodeMap::Length () const
pure virtual

Get number of nodes in list

The range of valid child node indices is 0 to length-1 inclusive.

Returns
Number of nodes
virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::RemoveNamedItem (const WideStringname)
pure virtual

Removes a node specified by name.

Parameters
nameThe nodeName of a node to remove.
Returns
The node that was removed. Nil if no item was removed Caller is responsible for releasing the node.
virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::RemoveNamedItemNS (const WideStringnamespaceURI,
const WideStringlocalName 
)
pure virtual

Removes a node specified by local name and namespace URI.

Parameters
namespaceURIThe namespace URI of the node to remove.
localNameThe local part of the node to remove. When this map contains the attributes attached to an element, as returned by the GetAttributes call of the IIDXMLDOMNode interface, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix.
Returns
The node that was removed. Nil if no item was removed. Caller is responsible for releasing the node.
virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::SetNamedItem (IIDXMLDOMNodenewNode)
pure virtual

Adds a node by name

As the nodeName attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a "special" string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased.

Parameters
newNodeA node to store in a named node map. The node will later be accessible using the value of the nodeName attribute of the node. If a node with that name is already present in the map, it is replaced by the new one.
Returns
If the new Node replaces an existing node, returns that node otherwise nil is returned
virtual IIDXMLDOMNode* IIDXMLDOMNamedNodeMap::SetNamedItemNS (IIDXMLDOMNodenewNode)
pure virtual

Adds a node by local name and namespace URI

As the nodeName attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a "special" string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased.

Parameters
newNodeA node to store in a named node map. The node will later be accessible using the value of the nodeName attribute of the node. If a node with that name is already present in the map, it is replaced by the new one.
Returns
If the new Node replaces an existing node, returns that node otherwise nil is returned