Sample code i Have share but it need updation base on given 2 condition for required output..Thank you for help.
#!/usr/bin/perl
use strict;
use warnings;
use XML::XPath;
use XML::LibXML::NodeList;
use Data::Dumper;
my @records;
my $bamxml = 'BAMOpenApi.xml';
my $bamxp = XML::XPath->new(filename => $bamxml);
my $bamxpath = $bamxp->findnodes('//nodes/node/children/node/chil
+dren/node');
my $pattern = shift;
my $matches = XML::LibXML::NodeList->new;
foreach my $bamnode ($bamxpath->get_nodelist) {
my $name = $bamxp->find('./@name',$bamnode)->string_value;
my $citype = $bamxp->find('./@ciType',$bamnode)->string_value;
my $status = $bamxp->find('./dimension/@status',$bamnode)->str
+ing_value;
my $time = $bamxp->find("./dimension/body/entry",$bamnode)->st
+ring_value;
s/^\s+|\s+$//g for $name,$citype,$status,$time;
push @records, {
name => $name,
citype => $citype,
status => $status,
Time => $time
};
}