mirror of
https://github.com/glest/glest-source.git
synced 2025-02-26 20:52:32 +01:00
24 lines
442 B
Perl
Executable File
24 lines
442 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
# Copyright 2011 olaus
|
|
# license: GPLv3 or newer
|
|
# 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";
|
|
}
|
|
|