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

    Thank you! Issue solved perfectly.

    In fact, thanks to all for again helping me in such a useful way!

    --
    The great mistake is to anticipate the outcome of the engagement; Let nature take its course, and your tools will strike at the right moment.