Subject: | Error removing child element |
I have a XML file sort of
<job><jobid>xxxx</jobid><other_stuff>...</other_stuff></job>
my chunk of code:
my $jobid = $docRoot->getElement('jobid');
if (defined $jobid){
$docRoot->removeChild('jobid') ;
}
what I get:
/Library/Perl/5.8.1/XML/Mini/Element.pm:584: Argument "jobid" isn't numeric in numeric eq (==)
It seems that I'm doing something wrong since your code compares whatever
I pass with some array of children which looks like something more
complex than a string.
Should I pass $jobid instead 'jobid'? Could be, in that case I get no
error, but the node remains in the tree.
Using $docRoot->toString, then printing shows the jobid element
still there...
Otherwise this module is pretty useful