HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/share/man/man3/XML::DOM::NamedNodeMap.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "XML::DOM::NamedNodeMap 3"
.TH XML::DOM::NamedNodeMap 3 "2000-01-31" "perl v5.26.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
XML::DOM::NamedNodeMap \- A hash table interface for XML::DOM
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Objects implementing the NamedNodeMap interface are used to represent
collections of nodes that can be accessed by name. Note that
NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not
maintained in any particular order. Objects contained in an object
implementing NamedNodeMap may also be accessed by an ordinal index, but
this is simply to allow convenient enumeration of the contents of a
NamedNodeMap, and does not imply that the \s-1DOM\s0 specifies an order to
these Nodes.
.PP
Note that in this implementation, the objects added to a NamedNodeMap
are kept in order.
.SS "\s-1METHODS\s0"
.IX Subsection "METHODS"
.IP "getNamedItem (name)" 4
.IX Item "getNamedItem (name)"
Retrieves a node specified by name.
.Sp
Return Value: A Node (of any type) with the specified name, or undef if
the specified name did not identify any node in the map.
.IP "setNamedItem (arg)" 4
.IX Item "setNamedItem (arg)"
Adds a node using its nodeName attribute.
.Sp
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 \*(L"special\*(R" string value) cannot be
stored as the names would clash. This is seen as preferable
to allowing nodes to be aliased.
.Sp
Parameters:
 \fIarg\fR  A node to store in a named node map.
.Sp
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.
.Sp
Return Value: If the new Node replaces an existing node with the same
name the previously existing Node is returned, otherwise undef is returned.
.Sp
DOMExceptions:
.RS 4
.IP "\(bu" 4
\&\s-1WRONG_DOCUMENT_ERR\s0
.Sp
Raised if arg was created from a different document than the one that 
created the NamedNodeMap.
.IP "\(bu" 4
\&\s-1NO_MODIFICATION_ALLOWED_ERR\s0
.Sp
Raised if this NamedNodeMap is readonly.
.IP "\(bu" 4
\&\s-1INUSE_ATTRIBUTE_ERR\s0
.Sp
Raised if arg is an Attr that is already an attribute of another Element object.
The \s-1DOM\s0 user must explicitly clone Attr nodes to re-use them in other elements.
.RE
.RS 4
.RE
.IP "removeNamedItem (name)" 4
.IX Item "removeNamedItem (name)"
Removes a node specified by name. If the removed node is an
Attr with a default value it is immediately replaced.
.Sp
Return Value: The node removed from the map or undef if no node with
such a name exists.
.Sp
DOMException:
.RS 4
.IP "\(bu" 4
\&\s-1NOT_FOUND_ERR\s0
.Sp
Raised if there is no node named name in the map.
.RE
.RS 4
.RE
.IP "item (index)" 4
.IX Item "item (index)"
Returns the indexth item in the map. If index is greater than
or equal to the number of nodes in the map, this returns undef.
.Sp
Return Value: The node at the indexth position in the NamedNodeMap, or
undef if that is not a valid index.
.IP "getLength" 4
.IX Item "getLength"
Returns the number of nodes in the map. The range of valid child node
indices is 0 to length\-1 inclusive.
.SS "Additional methods not in the \s-1DOM\s0 Spec"
.IX Subsection "Additional methods not in the DOM Spec"
.IP "getValues" 4
.IX Item "getValues"
Returns a NodeList with the nodes contained in the NamedNodeMap.
The NodeList is \*(L"live\*(R", in that it reflects changes made to the NamedNodeMap.
.Sp
When this method is called in a list context, it returns a regular perl list
containing the values. Note that this list is not \*(L"live\*(R". E.g.
.Sp
.Vb 3
\& @list = $map\->getValues;        # returns a perl list
\& $nodelist = $map\->getValues;    # returns a NodeList (object ref.)
\& for my $val ($map\->getValues)   # iterate over the values
.Ve
.IP "getChildIndex (node)" 4
.IX Item "getChildIndex (node)"
Returns the index of the node in the NodeList as returned by getValues, or \-1
if the node is not in the NamedNodeMap.
.IP "dispose" 4
.IX Item "dispose"
Removes all circular references in this NamedNodeMap and its descendants so the 
objects can be claimed for garbage collection. The objects should not be used
afterwards.