All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

XMLParser Interface CATIDOMNamedNodeMap

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---CATIDOMNamedNodeMap
 

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIDOMNamedNodeMap

Interface used to represent collections of nodes that can be accessed by name.
Note that CATIDOMNamedNodeMap does not inherit from CATIDOMNodeList ; CATIDOMNamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing CATIDOMNamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a CATIDOMNamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.

CATIDOMNamedNodeMap objects in the DOM are live.


Method Index


o GetLength(int&)
Retrieves the number of nodes in this map.
o GetNamedItem(CATUnicodeString&,CATIDOMNode_var&)
Retrieves a node specified by name.
o GetNamedItemNS(CATUnicodeString&,CATUnicodeString&,CATIDOMNode_var&)
Retrieves a node specified by local name and namespace URI.
o Item(int,CATIDOMNode_var&)
Retrieves the indexth item in the map.
o RemoveNamedItem(CATUnicodeString&,CATIDOMNode_var&)
Removes a node specified by name.
o RemoveNamedItemNS(CATUnicodeString&,CATUnicodeString&,CATIDOMNode_var&)
Removes a node specified by local name and namespace URI.
o SetNamedItem(CATIDOMNode_var&,CATIDOMNode_var&)
Adds a node using its nodeName attribute.
o SetNamedItemNS(CATIDOMNode_var&,CATIDOMNode_var&)
Adds a node using its namespace URI and local name.

Methods


o GetLength
public virtual HRESULT GetLength(int& oLength) = 0
Retrieves the number of nodes in this map. The range of valid child node indices is 0 to oLength - 1 inclusive.
Parameters:
oLength
The retrieved number of nodes in this map.
o GetNamedItem
public virtual HRESULT GetNamedItem( const CATUnicodeString& iName,
CATIDOMNode_var& oNamedItem) = 0
Retrieves a node specified by name.
Parameters:
iName
The name of a node to retrieve.
oNamedItem
A
CATIDOMNode (of any type) with the specified name, or NULL_var if it does not identify any node in this map.
See also:
CATIDOMNode, CATIDOMNode.GetNodeName
o GetNamedItemNS
public virtual HRESULT GetNamedItemNS( const CATUnicodeString& iNamespaceURI,
const CATUnicodeString& iLocalName,
CATIDOMNode_var& oItem) = 0
Retrieves a node specified by local name and namespace URI.
Parameters:
iNamespaceURI
The namespace URI of the node to retrieve. When it is an empty string, this method behaves like
GetNamedItem.
iLocalName
The local name of the node to retrieve.
oItem
A
CATIDOMNode (of any type) with the specified name, or NULL_var if the specified name did not identify any node in the map.
See also:
CATIDOMNode
o Item
public virtual HRESULT Item(int iIndex,
CATIDOMNode_var& oItem) = 0
Retrieves the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns NULL_var.
Parameters:
iIndex
Index into this map.
oItem
The node at the indexth position in the map, or NULL_var if that is not a valid index.
See also:
CATIDOMNode
o RemoveNamedItem
public virtual HRESULT RemoveNamedItem( const CATUnicodeString& iName,
CATIDOMNode_var& oNamedItem) = 0
Removes a node specified by name. When this map contains the attributes attached to an element, 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 when applicable.
Parameters:
iName
The name of the node to remove.
oNamedItem
The node removed from this map if a node with such a name exists.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2208 NOT_FOUND_ERR: Raised if there is no node named iName in this map.
CATDOMException XMLParserERR_2207 NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
See also:
CATIDOMNode, CATIDOMNode.GetNodeName
o RemoveNamedItemNS
public virtual HRESULT RemoveNamedItemNS( const CATUnicodeString& iNamespaceURI,
const CATUnicodeString& iLocalName,
CATIDOMNode_var& oRemovedNode) = 0
Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value when this map contains the attributes attached to an element, as returned by the attributes attribute of the CATIDOMNode interface. If so, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.
Parameters:
iNamespaceURI
The namespace URI of the node to remove.
iLocalName
The local name of the node to remove.
oRemovedNode
The node removed from this map if a node with such a local name and namespace URI exists.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2208 NOT_FOUND_ERR: Raised if there is no node named iNamespaceURI and iLocalName in this map.
CATDOMException XMLParserERR_2207 NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
See also:
CATIDOMNode, CATIDOMNode.GetNamespaceURI, CATIDOMNode.GetLocalName
o SetNamedItem
public virtual HRESULT SetNamedItem( const CATIDOMNode_var& iNodeToStore,
CATIDOMNode_var& oOldNode) = 0
Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one.
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:
iNodeToStore
The node to store in this map. The node will later be accessible using the return value of its
CATIDOMNode.GetNodeName method.
oOldNode
If the new
CATIDOMNode replaces an existing node, oOldNode is set to the replaced CATIDOMNode, otherwise it is set to NULL_var.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2204 WRONG_DOCUMENT_ERR: Raised if iNodeToStore was created from a different document than the one that created this map.
CATDOMException XMLParserERR_2207 NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
CATDOMException XMLParserERR_2210 INUSE_ATTRIBUTE_ERR: Raised if iNodeToStore is an CATIDOMAttr that is already an attribute of another CATIDOMElement object. The DOM user must explicitly clone CATIDOMAttr nodes to re-use them in other elements.
See also:
CATIDOMNode
o SetNamedItemNS
public virtual HRESULT SetNamedItemNS( const CATIDOMNode_var& iNamedItemNS,
CATIDOMNode_var& oOldNode) = 0
Adds a node using its namespace URI and local name. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one.
Parameters:
iNamedItemNS
The node to store in this map. The node will later be accessible using the return value of its
CATIDOMNode.GetNamespaceURI and CATIDOMNode.GetLocalName methods.
oOldNode
If the new
CATIDOMNode replaces an existing node, oOldNode is set to the replaced CATIDOMNode, otherwise to NULL_var.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2204 WRONG_DOCUMENT_ERR: Raised if iNamedItemNS was created from a different document than the one that created this map.
CATDOMException XMLParserERR_2207 NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
CATDOMException XMLParserERR_2210 INUSE_ATTRIBUTE_ERR: Raised if iNodeToStore is a CATIDOMAttr that is already an attribute of another CATIDOMElement object. The DOM user must explicitly clone CATIDOMAttr nodes to re-use them in other elements.
See also:
CATIDOMNode, CATIDOMNode.GetNamespaceURI, CATIDOMNode.GetLocalName

This object is included in the file: CATIDOMNamedNodeMap.h
If needed, your Imakefile.mk should include the module: CATXMLParserItf

Copyright © 2003, Dassault Systèmes. All rights reserved.