XML::Li...ression(3)
β¨ NAME β¨
XML::LibXML::XPathExpression β bestie, it's the interface to libxml2's pre-compiled XPath expressions π
(this one's living in the XML::LibXML::XPathExpression(3) manual page, just so you know where you are π«Ά)
πΈ SYNOPSIS πΈ
use XML::LibXML;
my $compiled_xpath = XML::LibXML::XPathExpression->new('//foo[@bar="baz"][position()<4]');
# interface from XML::LibXML::Node
my $result = $node->find($compiled_xpath);
my @nodes = $node->findnodes($compiled_xpath);
my $value = $node->findvalue($compiled_xpath);
# interface from XML::LibXML::XPathContext
my $result = $xpc->find($compiled_xpath,$node);
my @nodes = $xpc->findnodes($compiled_xpath,$node);
my $value = $xpc->findvalue($compiled_xpath,$node);
$compiled = XML::LibXML::XPathExpression->new( xpath_string );
π DESCRIPTION π
okay so here's the tea β β this is a perl interface to libxml2's pre-compiled XPath expressions. and why do we care? because pre-compiling an XPath expression can give you some performance benefit if you're evaluating the same XPath query over and over and over again. it's giving "do the work once, reap the rewards forever" β¨
XML::LibXML::XPathExpression objects can be passed to all the find... functions in XML::LibXML that expect an XPath expression. no cap. every single one that wants an XPath expression will happily take one of these π
π new()
$compiled = XML::LibXML::XPathExpression->new( xpath_string );
the constructor takes an XPath 1.0 expression as a string and hands you back an object representing the pre-compiled expressions. and bestie, before you ask β the actual data structure is internal to libxml2, so don't go poking at its insides, it's not yours π
π AUTHORS π
Matt Sergeant, Christian Glahn, Petr Pajas
the icons who built this. we stan π«Ά
β VERSION β
2.0213
π COPYRIGHT π
- 2001-2007, AxKit.com Ltd.
- 2002-2006, Christian Glahn.
- 2006-2009, Petr Pajas.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, go forth and remix π¦
and that's the whole page, bestie π no notes, no crumbs, it ate.
signing off from perl v5.42.2, dated 2026-05-25, in the XML::Li...ression(3) manual β periodt π
β¨
π¦ where this page comes from
- fedora 43: perl-XML-LibXML 1:2.0213-1.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- fedora 44: perl-XML-LibXML 1:2.0213-1.fc44 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms