I was trying to get child nodes when a match is found , but i always end up getting all the child nodes.
my @groups1 = $xp->find('/product/prod_cont1')->get_nodelist;
my @groups2 = $xp->find('/product/prod_cont1/prod_cont2')->get_nodelist;
for (@groups1) {
if(($xp->find('./prod_cont1_title', $_)->string_value) eq "TV"){
for (@groups2) {
print $xp->find('./prod_cont2_title', $_)->string_value;
}
}else{
print "No TV Available\n";
}
}
I want title for all child nodes of prod_cont2 when the tile in the prod_cont1 is "TV".
Thanks