Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: parsing of xml with mutiple tags

by Kanishka.black0 (Scribe)
on Jun 12, 2010 at 22:03 UTC ( #844373=note: print w/ replies, xml ) Need Help??


in reply to parsing of xml with mutiple tags

you need Xpath modules to get the exact value of the Node ....try XML::Xpath

i tried to use XML::LibXML but ran into some problems .. please post the code Cleanly .....

i just pasted the xml into a hello.xml ....
use XML::LibXML; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file('hello.xml'); foreach my $book ($doc->findnodes('/result/suites/suite/cases/case') +) { my($title) = $book->findnodes('./className'); print $title->to_literal, "\n" }
i think this is what you are looking for ...


Comment on Re: parsing of xml with mutiple tags
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-07-29 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls