1XML::Grove::Path(3) User Contributed Perl Documentation XML::Grove::Path(3)
2
3
4
6 XML::Grove::Path - return the object at a path
7
9 use XML::Grove::Path;
10
11 # Using at_path method on XML::Grove::Document or XML::Grove::Element:
12 $xml_obj = $grove_object->at_path("/some/path");
13
14 # Using an XML::Grove::Path instance:
15 $pather = XML::Grove::Path->new();
16 $xml_obj = $pather->at_path($grove_object);
17
19 "XML::Grove::Path" returns XML objects located at paths. Paths are
20 strings of element names or XML object types seperated by slash ("/")
21 characters. Paths must always start at the grove object passed to
22 `"at_path()"'. "XML::Grove::Path" is not XPath, but it should become
23 obsolete when an XPath implementation is available.
24
25 Paths are like URLs
26
27 /html/body/ul/li[4]
28 /html/body/#pi[2]
29
30 The path segments can be element names or object types, the objects
31 types are named using:
32
33 #element
34 #pi
35 #comment
36 #text
37 #cdata
38 #any
39
40 The `"#any"' object type matches any type of object, it is essentially
41 an index into the contents of the parent object.
42
43 The `"#text"' object type treats text objects as if they are not
44 normalized. Two consecutive text objects are seperate text objects.
45
47 Ken MacLeod, ken@bitsko.slc.ut.us
48
50 perl(1), XML::Grove(3)
51
52 Extensible Markup Language (XML) <http://www.w3c.org/XML>
53
54
55
56perl v5.32.1 2021-01-27 XML::Grove::Path(3)