dfd1f59db3
- added a script to install required modules to run the script in Ubuntu
22 lines
393 B
Perl
Executable File
22 lines
393 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
# show xpath in file, google xpath for syntax
|
|
|
|
|
|
if ( !@ARGV ) {
|
|
die "\n\nusage $0 file xpath\n\n";
|
|
}
|
|
|
|
use strict;
|
|
use XML::XPath;
|
|
use XML::XPath::XMLParser;
|
|
|
|
my $xpath = XML::XPath->new( filename => shift @ARGV );
|
|
|
|
my $nodeset = $xpath->find( shift @ARGV );
|
|
|
|
foreach my $node ( $nodeset->get_nodelist ) {
|
|
print XML::XPath::XMLParser::as_string( $node ) . "\n";
|
|
}
|
|
|