ETC...my $xquery = '//metadata/audience/@name';# find the first <audience n +ame="xyz"> my $xquery2 = "//othermeta[\@name = 'plugin.id']/\@content";# find an +othermeta with a name = plugin.id and @content my $xquery3 = '//@xml:lang'; # find first @xml:lang my $xparser = XML::LibXML->new(); # create new parser object eval { $xmldoc = $xparser->parse_file($file) }; # trap parsing errors + that can't be suppressed normally, like entities if ($@){ print "Problems! \n The error(s):\n$@\n"; } if ($pluginname = $xmldoc->findvalue( $xquery2 )){ # returns value +of plugin name print " Plugin name found: $pluginname\n"; }
In reply to Re: Finding node with attribute XML::LibXML
by stylechief
in thread Finding node with attribute XML::LibXML
by jjap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |