Playing around with XML::LibXML::Attribute objects is usually unnecessary. It's easier to select the element and then use getAttribute and setAttribute, or if you have a vaguely recent copy of XML::LibXML, just treat the element as a hashref...
use strict; use warnings; use XML::LibXML 2; my $xml = 'XML::LibXML'->load_xml(IO => \*DATA); $_->{value}++ for $xml->findnodes('//key[@name="Repetitions"]'); print $xml->toString; __DATA__ <root> <parameters> <key name="Repetitions" value="500" /> <key name="Mode" value="COLD" /> ... </parameters> </root>
In reply to Re^2: Modifying XML with LibXML
by tobyink
in thread Modifying XML with LibXML
by jasal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |