我想替换 xml 文件中元素的“VAL1”值
由于某种原因,它对我不起作用:
<testing>
<application_name>TEST</application_name>
<application_id>VAL1</application_id>
<application_password>1234</application_password>
</testing>
my $parser =XML::LibXML->new();
$tree =$parser->parse_file($xml);
$root =$tree->getDocumentElement;
my ($elem)=$root->findnodes('/testing/application_id');
$elem->setValue('VAL2');
错误是“无法通过包“XML::LibXML::Element ...”找到对象方法“setValue”