-
-
15 Apr 2008 15:35:41 UTC
- Distribution: XML-DOM-XPath
- Module version: 0.14
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (3101 / 638 / 0)
- Kwalitee
Bus factor: 0- 83.33% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (12.12KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- XML::DOM
- XML::XPathEngine
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
XML::DOM::XPath - Perl extension to add XPath support to XML::DOM, using XML::XPath engine
SYNOPSIS
use XML::DOM::XPath; my $parser= XML::DOM::Parser->new(); my $doc = $parser->parsefile ("file.xml"); # print all HREF attributes of all CODEBASE elements # compare with the XML::DOM version to see how much easier it is to use my @nodes = $doc->findnodes( '//CODEBASE[@HREF]/@HREF'); print $_->getValue, "\n" foreach (@nodes);
DESCRIPTION
XML::DOM::XPath allows you to use XML::XPath methods to query a DOM. This is often much easier than relying only on getElementsByTagName.
It lets you use all of the XML::DOM methods.
METHODS
Those methods can be applied to a whole dom object or to a node.
findnodes($path)
return a list of nodes found by $path.
findnodes_as_string($path)
return the nodes found reproduced as XML. The result is not guaranteed to be valid XML though.
findvalue($path)
return the concatenation of the text content of the result nodes
exists($path)
return true if the given path exists.
matches($path)
return true if the node matches the path.
SEE ALSO
XML::DOM XML::XPathEngine
AUTHOR
Michel Rodriguez, mirod@cpan.org
COPYRIGHT AND LICENSE
Copyright 2003 by Michel Rodriguez
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install XML::DOM::XPath, copy and paste the appropriate command in to your terminal.
cpanm XML::DOM::XPath
perl -MCPAN -e shell install XML::DOM::XPath
For more information on module installation, please visit the detailed CPAN module installation guide.