in reply to Re^3: Update an XML node value based on one of the attribute values.
in thread Update an XML node value based on one of the attribute values.

For the code from tobyink
use strict; use warnings; use XML::LibXML 2; my $doc = 'XML::LibXML'->load_xml(IO => \*DATA); foreach my $node ( $doc->findnodes('//ReferenceID') ) { $node->firstChild->setData("Reference ID type is $node->{reference +IDType}") if $node->{referenceIDType} eq 'FXDD'; } print $doc->toString;

when i use $node ->setData("xyz"); i again get the same error. Please excuse my ignorance, i am very new to perl scripting.
  • Comment on Re^4: Update an XML node value based on one of the attribute values.
  • Download Code

Replies are listed 'Best First'.
Re^5: Update an XML node value based on one of the attribute values.
by Laurent_R (Canon) on Apr 18, 2014 at 13:27 UTC
    Your closing code tag should be </code>, not <code>. Please check your posts in the preview page before posting for real. And, please also insert code tags in your original post.