use strict; #use warnings; use Data::Dumper; use XML::DOM; my $parser=new XML::DOM::Parser; my $doc = $parser->parsefile('C:\perl\perl_tests\AirbgICIndPer2.xml')or die$!; my $root=$doc->getDocumentElement(); print("Enter the number of flags which needs to be removed...\n\n"); my $num2=; if($num2>0) { for(my $p=0;$p<$num2;$p++) { print("type the signal id for which flags need to be removed..\n\n"); my $sig_id=; print("type the flag name which needs to be removed according to the instructions\n\n"); print("State on flag remove : type StateOn\n"); print("Indication Function remove : type IndicationFunctions\n"); print("First value flags remove : type FirstValueFlags\n"); print("timeout notification flag remove : type TimeoutFlags\n\n"); my $flag_to_be_modified=; print("processing geny file data\n"); ClearSignalAttribute($sig_id,$flag_to_be_modified); } sub ClearSignalAttribute($$) { my $sigid=$_[0]; my $attribute=$_[1]; my $sigattributes; my $sig; my @attributes; my @signals; my $signal_id; $sig=$root->getElementsByTagName("signal")->item(0); $signal_id=$sig->getAttribute("sigid"); print("the input signal id is : $sigid\n"); print("the other signal id is : $signal_id\n"); if($sigid==$signal_id) { print("signal id matched\n"); if($sig->getElementsByTagName("attributes")) { $sigattributes=$sig->getElementsByTagName("attributes")->item(0); @attributes=$sigattributes->getElementsByTagName("attribute"); print("got the attributes\n"); } foreach my $attr(@attributes) { my $a=$attr->getAttribute("name"); print("into the attribute array: $a\n"); my $c="VIlRx".$attribute; print("the target is : $c\n"); #if($attr->getAttribute("name") eq "VIlRx".$attribute) if($a eq $c) { print("attribute matched:$a\n"); if(my $temp1=$attr->getElementsByTagName("item")->item(0)) { print("got the item element\n"); if(my $temp2=$temp1->getElementsByTagName("data")->item(0)) { print("got the data element\n"); if ($temp1->getAttribute("used")=='1') { $b=$temp1->getAttribute("used"); print("Attribute->used : $b\n"); $temp1->setAttribute("used","0"); $temp1->setAttribute("order","-1"); $temp2->setAttribute("flags","4"); my $w=$temp1->getAttribute("used"); my $x=$temp1->getAttribute("order"); my $y=$temp2->getAttribute("flags"); print("used : $w\n"); print("order : $x\n"); print("flags : $y\n"); } } } } } } } #$doc->setXMLDecl($doc->createXMLDecl('1.0','UTF-8')); #$doc->printToFile("C:/perl/perl_tests/AirbgICIndPer2.xml"); } XML FILE : This attribute has been disabled by IL_Vector component.