in reply to LibXML: Can't get value of attribute using DOM

Use @ before attribute names, also, you can't skip property , and you need to use quotes for values. Values, attributes, and elements are three different notions.
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::LibXML; my $dom = 'XML::LibXML'->load_xml(location => 'imgfile.xml'); say 'XML Version is: ', $dom->version; say 'Document encoding is: ', $dom->encoding; for my $image ( $dom->findnodes('imgfile/images/views/view/nodes/node/properties') ) { for my $property (qw( Description Hight Width )) { # Height? say "$property: ", $image->findvalue("property[\@type='$proper +ty']"); } }

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: LibXML: Can't get value of attribute using DOM
by timtowtdi (Sexton) on Nov 11, 2016 at 08:30 UTC
    Yes height :-) Thank you! Really happy that it works now.
    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.