XML::Li...dNodeMap(3)

๐Ÿ“ฆ
version 2.0213 ยท 2 versions
, in fedora 43, fedora 44

โœจ 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. ๐Ÿ’…


  • 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