http://qs1969.pair.com?node_id=11140628

vlearner has asked for the wisdom of the Perl Monks concerning the following question:

sorry for completely updating my question again, as the code mentioned below is removing all the <alt> tags in the .dita files which I have not attached here, so I need to provide the functionality of whether to remove the <alt> tag from the script or not to remove it. kindly guide me how should I update the below code with the required functionality.

sub RemoveAltTag($) { my $doc = shift; ############################## my $cnt = 0; my $nodes = $doc->getElementsByTagName("image"); for(my $i = 0;$i < $nodes->getLength(); $i++) { my $kids = $nodes->item($i)->getChildNodes(); for(my $k =0; $k < $kids->getLength(); $k++) { if($kids->item($k)->toString() =~ /<alt>/i) { $nodes->item($i)->removeChild($kids->item($k)); print "\n Removed <alt> tag" if $VERBOSE; $cnt++ } } } return $cnt;