@choroba:
Thanks so much for your response!.
Looks interesting wrt xpath look a like. But running into below errors ( modified a little)
#! perl -w
use warnings;
use strict;
use XML::XSH2;
my $tempVal = XML::XSH2->new( twig_handlers => { /httpsRoutes/httpsRou
+te } );
$tempVal->parsefile("c:\\location\\test.xml");
for ($tempVal) {
echo @hostname (key) @tier | cat > out.txt;
}
errors:
C:\Strawberry\perl\bin>perl "C:\location\xmlRead_2.pl"
Array found where operator expected at C:\location\xmlRead_2.pl line 10, at end of line
(Missing operator before ?)
Array found where operator expected at C:\location\xmlRead_2.pl line 10, at end of line
(Missing operator before ?)
Unknown regexp modifier "/h" at C:\location\xmlRead_2.pl line 6, at end of line
Unknown regexp modifier "/t" at C:\location\xmlRead_2.pl line 6, at end of line
Unknown regexp modifier "/t" at C:\location\xmlRead_2.pl line 6, at end of line
Unknown regexp modifier "/R" at C:\location\xmlRead_2.pl line 6, at end of line
Unknown regexp modifier "/t" at C:\location\xmlRead_2.pl line 6, at end of line
Unknown regexp modifier "/e" at C:\location\xmlRead_2.pl line 6, at end of line
syntax error at C:\location\xmlRead_2.pl line 10, near "echo @hostname "
Global symbol "@hostname" requires explicit package name at C:\location\xmlRead_2.pl line 10.
Global symbol "@tier" requires explicit package name at C:\location\xmlRead_2.pl line 10.
Execution of C:\location\xmlRead_2.pl aborted due to compilation errors.
|