The getAttribute method just takes the name of the attribute for its parameter, not an xpath statement from what I could tell. The way poj did it is likely better but this is a quick fix to your program.
# NOW WORKING for my $fileline ( $dom->findnodes('/files/file[@name="Image"]/item') +) { my ($namenode) = $fileline->findnodes('field[@name="Name"]'); my ($sizenode) = $fileline->findnodes('field[@name="Size"]'); say 'Name : ', $namenode->getAttribute('value'); say 'Size : ', $sizenode->getAttribute('value'); }
In reply to Re: LibXML: Can't get value
by Lotus1
in thread LibXML: Can't get value
by timtowtdi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |