In the chatterbox the OP said he is trying to use XML::Simple as he does not understand XML::Twig. Please allow me to show an XML::Twig example in case he changes his mind.
use warnings; use strict; use XML::Twig; my $twig = XML::Twig->new; $twig->parse(*DATA); for my $query ($twig->findnodes("/queries/query")) { my $name = $query->field("name"); my $topN = $query->field("topN"); print "query name=($name) topN=($topN)\n"; } __DATA__ <?xml version='1.0'?> <queries> <query> <name>topHosts</name> <layer>LINK</layer> <topN>20</topN> <datatype>topHosts</datatype> <filter></filter> </query> <query> <name>topHosts</name> <layer>LINK</layer> <topN>120</topN> <datatype>topHosts</datatype> <filter></filter> </query> </queries>
In reply to Re: XML parsing problem
by ambrus
in thread XML parsing problem
by avi_2009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |