XML::Grove::Path(3pm)

XML::Grove::Path3pm

Return the object at a path

Usage

 use XML::Grove::Path;
 # Using at_path method on XML::Grove::Document or XML::Grove::Element:
 $xml_obj = $grove_object->at_path("/some/path");
 # Using an XML::Grove::Path instance:
 $pather = XML::Grove::Path->new();
 $xml_obj = $pather->at_path($grove_object);

Overview

"XML::Grove::Path" returns XML objects located at paths. Paths are strings of element names or XML object types separated by slash ("/") characters. Paths must always start at the grove object passed to `"at_path()"'. "XML::Grove::Path" is not XPath, but it should become obsolete when an XPath implementation is available.

Paths are like URLs

    /html/body/ul/li[4]
    /html/body/#pi[2]

The path segments can be element names or object types, the objects types are named using:

    #element
    #pi
    #comment
    #text
    #cdata
    #any

The `"#any"' object type matches any type of object, it is essentially an index into the contents of the parent object.

The `"#text"' object type treats text objects as if they are not normalized. Two consecutive text objects are separate text objects.

Releases

13 releases since Debian 2.2 (Potato); the text changed 6 times.

  1. 2.2
  2. 3.0
  3. 3.1–5.0
  4. 6.0–9
  5. 10
  6. 11
  7. 12–13

Author

Ken MacLeod, [email protected]

From libxml-grove-perl 0.46alpha-14 in Debian 13 (Trixie). Parsed by carta from the page's man source.