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 \s-1DOM\s0. This is often much easier than relying only on getElementsByTagName.

It lets you use all of the \s-1XML::DOM\s0 methods.

METHODS

Those methods can be applied to a whole dom object or to a node.

\$1

return a list of nodes found by $path. return the nodes found reproduced as \s-1XML\s0. The result is not guaranteed to be valid \s-1XML\s0 though. return the concatenation of the text content of the result nodes return true if the given path exists. return true if the node matches the path.

RELATED TO XML::DOM::XPath…

XML::DOM

XML::XPathEngine

AUTHOR

Michel Rodriguez, [email protected]

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.