in reply to LibXML: Can't get value
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'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LibXML: Can't get value
by timtowtdi (Sexton) on Mar 20, 2017 at 10:35 UTC |