in reply to
Re: Stepping up from XML::Simple to XML::LibXML
in thread Stepping up from XML::Simple to XML::LibXML
This is the exact problem I am trying to solve now (namespace defined at library).
I added:
my $xc = XML::LibXML::XPathContext->new($doc);<br/>
$xc->registerNs('ns', 'xmlapi_1.0');
and changed the foreach to:
foreach my $book ($xc->findnodes('//ns:book')) {
But no matter what I try, I can't get book's attributes.
I know I'm getting the info (print $book->to_literal, "\n";) but how do I access the info individually?