Spidy has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, fellow monks.
Spidy
A recent project I've been working on involves XML that looks like this:
<inbox> <item> <title>Foo</title> <description>Bar</description> </item> <item> <title>Baz</title> <description>Foobar</description> </item> </inbox>
We want to load in the XML, and then loop through all of the childnodes of the inbox element(the <item>'s), before outputting a list of all the item titles. We have loaded in the XML file using this snippet:
my $xml = XML::Simple->new(); my $d = $xml->XMLin("$u.xml",ForceArray => 1, KeepRoot => 1);
Does anyone know what I would need to do to loop through each item under inbox?
Thanks,Spidy
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::Simple: Loop through childnodes?
by GrandFather (Saint) on Feb 16, 2007 at 01:01 UTC | |
by Herkum (Parson) on Feb 16, 2007 at 03:10 UTC | |
by Anonymous Monk on Mar 28, 2011 at 21:21 UTC | |
Re: XML::Simple: Loop through childnodes?
by xdg (Monsignor) on Feb 16, 2007 at 02:29 UTC | |
by Jenda (Abbot) on Feb 17, 2007 at 19:45 UTC |
Back to
Seekers of Perl Wisdom