Gianni Ceccarelli > PPIx-XPath > PPIx::XPath

Download:
PPIx-XPath-2.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 2.01   Source  

NAME ^

PPIx::XPath - an XPath implementation for the PDOM

SYNOPSIS ^

  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");

DESCRIPTION ^

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.

Mapping the PDOM to the XPath data model

BUGS and LIMITATIONS ^

SEE ALSO ^

PPI

Tree::XPathEngine

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

AUTHOR ^

Dan Brook <cpan@broquaint.com> original author

Gianni Ceccarelli <dakkar@thenautilus.net> Tree::XPathEngine-based re-implementation

syntax highlighting: