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

hi, i am getting the elements by tagname as under:
my @envNode = $root->getElementsByTagName(EnvironmentSection);
But if environmentsection is supplied instead of "EnvironmentSection" we cannot extract anything from XML file. How can we make DOM accept case sensitive tagnames ? something in regular expressions like
$code=~s/EnvironmentSection/i;

Please help me. Thanks in advance, Pavan

Replies are listed 'Best First'.
Re: Regarding XML::DOM
by ikegami (Patriarch) on Feb 16, 2010 at 07:30 UTC

    XML is case sensitive. It would make more sense to adjust whatever is producing the broken XML.

    You could visit the tree and change the tagname of every node to lowercase. Then you'd use

    my @envNode = $root->getElementsByTagName(lc('EnvironmentSection'));