use XML::LibXML; my $template = 'sample.xml'; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($template); my($object) = $doc->findnodes("/project/run_count/count/text()"); my $text = XML::LibXML::Text->new('14'); $object->replaceNode($text); open (my $Output, ">$template") or die "Could not write $template"; print $Output $doc->toString; close ($Output) or die "Could not close generated $template ";
In reply to Re: Edit a node value in xml
by ramrod
in thread Edit a node value in xml
by PolarSiva
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |