Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Stepping up from XML::Simple to XML::LibXML

by Anonymous Monk
on Oct 22, 2008 at 22:00 UTC ( #718885=note: print w/ replies, xml ) Need Help??


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?


Comment on Re^2: Stepping up from XML::Simple to XML::LibXML
Select or Download Code
Re^3: Stepping up from XML::Simple to XML::LibXML
by grantm (Parson) on Oct 23, 2008 at 00:36 UTC

    That problem was addressed in a separate thread. I meant to provide a link from here but then I forgot.

    Aristotle provided a comprehensive answer in this node.

      Thanks grantm. Please see me reply to that post. I'm still missing... something!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://718885]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-08-21 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls