NodeIterator - DOM style node iterator
use XML::DOM::Lite::Node::Constants qw(:all); my $nfilt = XML::DOM::Lite::NodeFilter->new(sub { my $node = shift; if ($node->tagName == 'storage') { return FILTER_ACCEPT; } else { return FILTER_SKIP; } }); my $niter = XML::DOM::Lite::NodeIterator->new( $template, SHOW_ELEMENT, # bitwise combinations supported eg. SHOW_ELEMENT | SHOW_TEXT $nfilt, ); my $node = $niter->nextNode();
To install XML::DOM::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::DOM::Lite
CPAN shell
perl -MCPAN -e shell install XML::DOM::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.