XML::Grove::Path(3pm)
β¨ NAME β¨
XML::Grove::Path β bestie, this one returns the object at a path π like you give it a path string and it hands you back the XML object chillin' there.
πΈ SYNOPSIS πΈ
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);
π¦ DESCRIPTION π¦
XML::Grove::Path returns XML objects located at paths. Okay so a path is just a string of element names or XML object types, and you glue those segments together with slash (/) characters. Slash = the divider, the little separators, the / of it all π
Important vibe check: paths must always start at the grove object passed to at_path(). No wandering off on your own, bestie β you start where you're told to start.
XML::Grove::Path is not XPath, no cap. And lowkey it should become obsolete once an XPath implementation is available. So enjoy it while it's here π«Ά
π Paths are like URLs
/html/body/ul/li[4]
/html/body/#pi[2]
The path segments can be element names or object types. The object types are named using:
#element
#pi
#comment
#text
#cdata
#any
The "#any" object type matches any type of object β it's essentially an index into the contents of the parent object. It's giving "idc what type it is, just gimme the nth one" π
The "#text" object type treats text objects as if they are not normalized. Two consecutive text objects are separate text objects. Periodt. Two is two, not one merged blob π
π AUTHOR π
Ken MacLeod, ken@bitsko.slc.ut.us
β SEE ALSO β
perl(1),XML::Grove(3)- Extensible Markup Language (XML)
<http://www.w3c.org/XML>
And that's the whole page, bestie! π¦ This lil' slice of documentation is from perl v5.36.0, dated 2022-11-29, and it lives under the name XML::Grove::Path(3pm) in the User Contributed Perl Documentation. Slay, go forth and at_path() responsibly πβ¨
π¦ where this page comes from
- debian bookworm: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms