
PPIx::XPath - an XPath implementation for the PDOM

use PPI;
use PPI::XPath;
use Tree::XPathEngine;
my $pdom = PPI::Document->new('some_code.pl');
my $xpath = Tree::XPathEngine->new();
my @subs = $xpath->findnodes('//Statement-Sub',$pdom);
my @vars = $xpath->findnodes('//Token-Symbol',$pdom);
Deprecated interface, backward-compatible with PPIx::XPath version 1:
use PPIx::XPath;
my $pxp = PPIx::XPath->new("some_code.pl");
my @subs = $pxp->match("//Statement::Sub");
my $vars = $pxp->match("//Token::Symbol");

This module augments PPI's classes with the methods required by Tree::XPathEngine, allowing you to perform complex XPath matches against any PDOM tree.
See Tree::XPathEngine for details about its methods.
PPI::, with :: replaced by -. That is:
($xpath_name = substr($pdom_node->class,5)) =~ s/::/-/g;


http://www.w3.org/TR/xpath (the XPath specification)

Dan Brook <cpan@broquaint.com> original author
Gianni Ceccarelli <dakkar@thenautilus.net> Tree::XPathEngine-based re-implementation