1XML::Grove::IDs(3) User Contributed Perl Documentation XML::Grove::IDs(3)
2
3
4
6 XML::Grove::IDs - return an index of `id' attributes in a grove
7
9 use XML::Grove::IDs;
10
11 # Using get_ids method on XML::Grove::Document or XML::Grove::Element:
12 $hash = $grove_object->get_ids($attr_name, $elements);
13
14 # Using an XML::Grove::IDs instance:
15 $indexer = XML::Grove::IDs->new($attr_name, $elements);
16 my $hash = {};
17 $grove_object->accept($indexer, $hash);
18
20 "XML::Grove::IDs" returns a hash index of all nodes in a grove with an
21 `id' attribute. The keys of the hash are the ID attribute value and
22 the value at that key is the element. `$attr_name' and `$elements' are
23 optional. The attribute name defaults to `"id"' if `$attr_name' is not
24 supplied. Indexing can be restricted to only certain elements, by
25 name, by providing a hash containing NAME=>1 values.
26
28 Ken MacLeod, ken@bitsko.slc.ut.us
29
31 perl(1), XML::Grove(3), Data::Grove::Visitor(3)
32
33 Extensible Markup Language (XML) <http://www.w3c.org/XML>
34
35
36
37perl v5.28.0 1999-08-17 XML::Grove::IDs(3)