XML::Simple help
by Geek.Shrek other posts by this author
Aug 13 2009 6:31PM messages near this date
view in the new Beta List Site
Re: XML Parrot Was: XML::Rules tagspec
|
Re: XML::Simple help
& XSLT Hi,
I'm trying to extract an element value by using XML Simple
Here's my input xml
<Library>
<book>
<id> 1</id>
<name> ABC</name>
</book>
<book>
<id> 2</id>
<name> ABC123</name>
</book>
<book>
<id> 3</id>
<name> ABCDEF</name>
</book>
</Library>
I'm trying to get the name of id "1"
my $LibList = XMLin('library.xml', forcearray=> 1, keyattr => ['id']);
my $name = $LibList-> {'1'}->{name};
print "Customer id " . $name . "\n";
Can someone tell me what did I do wrong?
Thanks,
__________________________________________________________________________________
Find local businesses and services in your area with Yahoo!7 Local.
Get started: http://local.yahoo.com.au
Thread:
Geek.Shrek
Jenda Krynicky
Terrence Brannon
Jenda Krynicky
Terrence Brannon
Jenda Krynicky
Grant McLean
|