#!/usr/bin/env perl -l
use strict;
use warnings;
use XML::LibXML;
my $file = 'pm_1082058_n4000-small.xml';
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($file);
for my $vm ($doc->findnodes('//matrix/vm[@type="br"]')) {
my $version = $vm->findvalue('./release/@version');
print 'Version: ', $version;
print 'Wanted: ', $vm->findvalue('./release/@wanted');
if ($version eq '7.2.1') {
print 'Found!';
last;
}
}
####
Version: 7.2.2
Wanted:
Version: 7.2.1
Wanted: YES
Found!
##
##
123.1106
124.1306
124.1500
124.1306
124.1500