XML::Grove::IDs(3pm)

πŸ“¦
version 0.46alpha Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– XML::Grove::IDs πŸ’–

okay bestie so this is the User Contributed Perl Documentation page for XML::Grove::IDs, and it's literally just a little indexer that goes "which of these elements has an id and what's it called" πŸŽ€


✨ NAME ✨

XML::Grove::IDs β€” return an index of id attributes in a grove πŸ¦‹


🌸 SYNOPSIS 🌸

use XML::Grove::IDs;

# Using get_ids method on XML::Grove::Document or XML::Grove::Element:
$hash = $grove_object->get_ids($attr_name, $elements);

# Using an XML::Grove::IDs instance:
$indexer = XML::Grove::IDs->new($attr_name, $elements);
my $hash = {};
$grove_object->accept($indexer, $hash);

πŸ‘‘ DESCRIPTION πŸ‘‘

XML::Grove::IDs returns a hash index of all nodes in a grove with an id attribute. no cap, that's the whole job πŸ’…

The keys of the hash are the ID attribute value, and the value at that key is the element. slay.

$attr_name and $elements are both optional β€” they're giving very "only if you want" energy.

  • $attr_name defaults to "id" if you don't supply it. so if you say nothing, it's looking for id. periodt.
  • Indexing can be restricted to only certain elements, by name, by providing a hash containing NAME=>1 values. so like a lil guest list for which elements get to be in the index 🌈

🫢 AUTHOR 🫢

Ken MacLeod, ken@bitsko.slc.ut.us


πŸ’œ SEE ALSO πŸ’œ


not me being obsessed with how simple this module is 😭 it just wants to know your ids, bestie. let it in.

and that's the vibe check β€” this page is from perl v5.36.0, dated 2022-11-29, filed under XML::Grove::IDs(3pm). mwah πŸ’‹ stay iconic ✨

πŸ“¦ where this page comes from