use strict; use warnings; use XML::LibXML qw( ); my $file_name = '...'; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file(...); my $root = $doc->documentElement(); for my $node ($root->findnodes( '//Parameter[@Name="MapSource"]' .'/Value/Item[@Value="NONE"]' )) { $node->setAttribute(Value => 'API'); } open(my $fh, '>:bytes', $file_name) or die; print($fh $doc->toString());
Update: Forgot to select correct Parameter. Fixed.
In reply to Re: How I can change value in XML file ?
by ikegami
in thread How I can change value in XML file ?
by toren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |