I am trying to print out content of nodes to do further process. Wanted to print x_id="123" and node "a" content. I am using XML:LibXML parser. Any suggestion? I am very new to this file parser.
Example XML:
<header>
<id x_id="123">
<a>testing</a>
<b></b>
</id>
</header>
Current not working code:
use strict;
use warnings;
use XML::LibXML;
my $template = "xx.xml";
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($template);
my($object) = $doc->findnodes("/header/id/");
print $doc->findvalue("/header/id/x_id");