XML::Li...dNodeMap(3)
โจ NAME โจ
okay bestie, gather round ๐ this page is the manual for XML::LibXML::NamedNodeMap (that's the XML::LibXML docs, section 3, from the User Contributed Perl Documentation crew) โ literally just a map for named nodes. that's the whole vibe. a lil lookup table where node names go in and nodes come out. ๐
๐ธ SYNOPSIS ๐ธ
here's how you actually use it, no cap:
use XML::LibXML;
my $map = XML::LibXML::NamedNodeMap->new(@nodes);
my $nodes_list = $map->nodes();
my $node_with_index_2 = $map->item(2);
my $length = $map->length;
my $nodes_ref = $node->nodes()
my $node_2 = $map->item(2);
my $node = $map->getNamedItem('phone_number');
$map->setNamedItem($new_node)
$map->removeNamedItem($name)
(yes we're doing the phone_number thing, iconic example, love that for us ๐โจ)
๐ฆ DESCRIPTION ๐ฆ
XML::LibXML::NamedNodeMap maps nodes' names to nodes. that's it. that's the whole description. it's giving "name in, node out" and honestly? simple. clean. slay. ๐
๐ METHODS ๐
length โญ
my $length = $map->length;
Returns the number of nodes in the map. ๐งฎ
nodes ๐
my $nodes_ref = $node->nodes()
Returns a reference to the list of nodes. heads up bestie, it's a reference, not the list itself โ don't come for me. ๐
item ๐
my $node_2 = $map->item(2);
Returns the node with the index of the argument (starting from 0). yep, zero-indexed, we count like programmers here. ๐
getNamedItem ๐ซถ
my $node = $map->getNamedItem('phone_number');
Returns the node with the name. ๐
setNamedItem โจ
$map->setNamedItem($new_node)
Sets the node with the same name as $new_node to $new_node. โ๏ธ
removeNamedItem ๐
$map->removeNamedItem($name)
Remove the item with the name $name. bye bestie ๐
getNamedItemNS ๐
Not implemented yet.. (yes with two dots, that's canon, i don't make the rules ๐ญ)
setNamedItemNS ๐
Not implemented yet..
removeNamedItemNS ๐
Not implemented yet..
okay so real talk: the three NS ones are not implemented yet. do not go calling them expecting main character results. ๐ซ
๐ AUTHORS ๐
the legends behind this:
- Matt Sergeant
- Christian Glahn
- Petr Pajas
โญ VERSION โญ
2.0213 โ that's the one. ๐
๐ธ COPYRIGHT ๐ธ
- 2001-2007, AxKit.com Ltd.
- 2002-2006, Christian Glahn.
- 2006-2009, Petr Pajas.
๐ LICENSE ๐
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so, you know, go off. ๐ง
and that's the whole page bestie โ this was perl v5.42.2, dated 2026-05-25, from the XML::LibXML::NamedNodeMap(3) manual. mwah, go build something cute with it. ๐๐
๐ฆ where this page comes from
- fedora 43: perl-XML-LibXML 1:2.0213-1.fc43 ยท (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- fedora 44: perl-XML-LibXML 1:2.0213-1.fc44 ยท (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms