I am trying to open an XML file, change the value of a single attribute and then save it as another file. I want to use LibXml as this is a standard we use.
I have tried the following and many other combinations but cannot get it to work.
Can anyone help?
my $parser = XML::LibXML->new(); my $tree = $parser->parse_file($file); my $root = $tree->getDocumentElement; my $meet_date = $root->getAttribute('meetingdate'); my($node) = $root->find('@meetingdate'); $node->setData($meetingdate); print $tree->toString;========== XML file stub ========<?xml version="1.0" ?> - <meeting meetingdate="08 Sep 2010" meetingJetbetnumber="9" meetingType="GR"