NAME
TPath::Expression - a compiled TPath expression
VERSION
version 0.001
SYNOPSIS
my $f = MyForester->new; # make a new forester for my sort of tree
my $path = $f->path('//foo[@bar][-1]'); # select the last foo with the bar property
my $tree = next_tree(); # get the next tree (hypothetical function)
my ($foo) = $path->select($tree); # get the desired node
$foo = $path->first($tree); # achieves the same result
DESCRIPTION
An object that will get us the nodes identified by our path expression.
ATTRIBUTES
f
The expression's TPath::Forester.
METHODS
first
Convenience method that returns the first node selected by this expression from the given tree. This method just delegates to select
and expects the same arguments.
select
Takes a tree and, optionally, an index and returns the nodes selected from this tree by the path. If you are doing many selections on a particular tree, you may save some work by using a common index for all selections.
ROLES
AUTHOR
David F. Houghton <dfhoughton@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by David F. Houghton.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.