B::XPath

Description

B::XPath class can search Perl optrees with XPath syntax. SYNOPSIS Perl represents programs internally as a tree of opcodes. To execute a program, it walks this tree, performing each operation as it encounters it. The B family of modules allows you to examine (and in some cases, manipulate) this optree on programs even as they run. B::XPath allows you to use XPath syntax to select ops in the optree. use B::XPath; my $node = B::XPath->fetch_root( &some_function ); my $root = B::XPath->fetch_main_root(); # find all global scalar accesses my @globals = $root->match( //gvsv ); # find all global scalar accesses within some_function() named $bob my @bobs = $node->match( //gvsv[@NAME="bob"] ); Class Methods There are two methods to use to start your match; both set the root of the tree to search. Theres also a nice helper method youll probably never use unless you find a bug. fetch_root( $subref ) This method returns the B::XPath::Node object at the root of the optree for the subroutine reference. All matches performed on this node will search this branch of the optree for matching nodes. fetch_main_root() This method returns the B::XPath::Node object at the root of the program. Use this to search your entire program (at least, the part of it outside of any given subroutine). find_op_class( $op ) Given a B::OP or descendent object, returns the name of the appropriate B::XPath::Node subclass to use to wrap that op so that B::XPath can manipulate it appropriately..

Xpath - Bxpath - Root - Search - Class - Perl - Optree - Fetch - Libraries - Programming

Published By:chromatic

License Type:Freeware

Date Added:22 October, 2010

Version:0.01

Price:Free

Downloads:82

Size:7.2 KB

Platform: Linux

What people say
- required fields
     
Related Downloads

Template::Plugin::XML is a XML plugin for the Template Toolkit. SYNOPSIS [% USE XML; dom = XML.dom(foo.xml); xpath = XML.xpath(bar.xml); simple = XML.simple(baz.xml); rss = XML.simple(news.rdf); %] [% USE XML(file=foo.xml); dom = XML.

DateAug 17, 2010

AuthorAndy Wardley

Size26.6 KB

LicenseFreeware

PriceFree

PlatformLinux

CategoryLinux Programming

Test::XML::XPath is a Perl module to test XPath assertions.

DateAug 9, 2010

AuthorDominic Mitchell

Size9.2 KB

LicenseFreeware

PriceFree

PlatformLinux

CategoryLinux Programming

XML Hammer application is a free and open-source tool that simplifies elementary XML actions like checking for well-formedness, validation, transformation and xpath searches using any JAXP implementation.

DateAug 31, 2010

AuthorEdwin Dankert

Size4.2 MB

LicenseFreeware

PriceFree

PlatformLinux

CategoryLinux Utilities

XML::LibXML::XPathContext is an XPath evaluation.

DateOct 21, 2010

AuthorIlya Martynov and Petr Pajas

Size256.0 KB

LicenseFreeware

PriceFree

PlatformLinux

CategoryLinux Programming

dom4j provides a Java library for working with XML, XPath, and XSLT.

DateSep 13, 2010

AuthorJames Strachan

Size317.4 KB

LicenseFreeware

PriceFree

PlatformLinux

CategoryLinux Programming