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?
In reply to Re^4: Perl XPath
by GoForIt
in thread Perl XPath
by GoForIt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |