in reply to Re^3: Perl XPath
in thread Perl XPath

I used the below approach to replace the node value.

my $parent = $node->getParentNode(); $parent->removeChild($node); my $element = XML::XPath::Node::Element->new('category +'); my $attr = XML::XPath::Node::Attribute->new($key, $val +ue); $element->appendAttribute($attr); $result = $parent->appendChild($element);

It works fine but the execution time is long. I've about 1000 nodes to change and the script takes 40 minutes to finish.

Is this a bad approach?