1XML::DOM::NamedNodeMap(U3s)er Contributed Perl DocumentatXiMoLn::DOM::NamedNodeMap(3)
2
3
4

NAME

6       XML::DOM::NamedNodeMap - A hash table interface for XML::DOM
7

DESCRIPTION

9       Objects implementing the NamedNodeMap interface are used to represent
10       collections of nodes that can be accessed by name. Note that
11       NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not
12       maintained in any particular order. Objects contained in an object
13       implementing NamedNodeMap may also be accessed by an ordinal index, but
14       this is simply to allow convenient enumeration of the contents of a
15       NamedNodeMap, and does not imply that the DOM specifies an order to
16       these Nodes.
17
18       Note that in this implementation, the objects added to a NamedNodeMap
19       are kept in order.
20
21       METHODS
22
23       getNamedItem (name)
24           Retrieves a node specified by name.
25
26           Return Value: A Node (of any type) with the specified name, or
27           undef if the specified name did not identify any node in the map.
28
29       setNamedItem (arg)
30           Adds a node using its nodeName attribute.
31
32           As the nodeName attribute is used to derive the name which the node
33           must be stored under, multiple nodes of certain types (those that
34           have a "special" string value) cannot be stored as the names would
35           clash. This is seen as preferable to allowing nodes to be aliased.
36
37           Parameters:
38            arg  A node to store in a named node map.
39
40           The node will later be accessible using the value of the nodeName
41           attribute of the node. If a node with that name is already present
42           in the map, it is replaced by the new one.
43
44           Return Value: If the new Node replaces an existing node with the
45           same name the previously existing Node is returned, otherwise undef
46           is returned.
47
48           DOMExceptions:
49
50           * WRONG_DOCUMENT_ERR
51               Raised if arg was created from a different document than the
52               one that created the NamedNodeMap.
53
54           * NO_MODIFICATION_ALLOWED_ERR
55               Raised if this NamedNodeMap is readonly.
56
57           * INUSE_ATTRIBUTE_ERR
58               Raised if arg is an Attr that is already an attribute of
59               another Element object.  The DOM user must explicitly clone
60               Attr nodes to re-use them in other elements.
61
62       removeNamedItem (name)
63           Removes a node specified by name. If the removed node is an Attr
64           with a default value it is immediately replaced.
65
66           Return Value: The node removed from the map or undef if no node
67           with such a name exists.
68
69           DOMException:
70
71           * NOT_FOUND_ERR
72               Raised if there is no node named name in the map.
73
74       item (index)
75           Returns the indexth item in the map. If index is greater than or
76           equal to the number of nodes in the map, this returns undef.
77
78           Return Value: The node at the indexth position in the NamedNodeMap,
79           or undef if that is not a valid index.
80
81       getLength
82           Returns the number of nodes in the map. The range of valid child
83           node indices is 0 to length-1 inclusive.
84
85       Additional methods not in the DOM Spec
86
87       getValues
88           Returns a NodeList with the nodes contained in the NamedNodeMap.
89           The NodeList is "live", in that it reflects changes made to the
90           NamedNodeMap.
91
92           When this method is called in a list context, it returns a regular
93           perl list containing the values. Note that this list is not "live".
94           E.g.
95
96            @list = $map->getValues;        # returns a perl list
97            $nodelist = $map->getValues;    # returns a NodeList (object ref.)
98            for my $val ($map->getValues)   # iterate over the values
99
100       getChildIndex (node)
101           Returns the index of the node in the NodeList as returned by get‐
102           Values, or -1 if the node is not in the NamedNodeMap.
103
104       dispose
105           Removes all circular references in this NamedNodeMap and its
106           descendants so the objects can be claimed for garbage collection.
107           The objects should not be used afterwards.
108
109
110
111perl v5.8.8                       2002-02-08         XML::DOM::NamedNodeMap(3)
Impressum