in reply to Update an XML node value based on one of the attribute values.

But getting error on the setData line.. Whats is it that could be wrong ? Thanks in advance.

What is this error? copy/paste friend :)

  • Comment on Re: Update an XML node value based on one of the attribute values.

Replies are listed 'Best First'.
Re^2: Update an XML node value based on one of the attribute values.
by amitp2011 (Initiate) on Apr 18, 2014 at 07:22 UTC
    Can't locate object method "setdata" via package "XML::LibXML::Element" at FX_Booking.pl line 460. This is the error i got.
      Well neither XML::LibXML::Element nor its base class XML::LibXML::Node list any "setdata" method, so not sure why you keep trying to use it :)

      $ perl -MXML::LibXML -le " print XML::LibXML::Element->new" Usage: XML::LibXML::Element::new(CLASS, name) at -e line 1. $ perl -MXML::LibXML -le " print XML::LibXML::Element->new(q{q})" <q/> $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +setData; print $q;" Can't locate object method "setData" via package "XML::LibXML::Element +" at -e line 1. $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +setValue; print $q;" Can't locate object method "setValue" via package "XML::LibXML::Elemen +t" at -e line 1. $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +nodeValue(66); print $q;" <q/> $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +nodeValue=(66); print $q;" Modification of a read-only value attempted at -e line 1. $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +replaceValue(55); print $q;" Can't locate object method "replaceValue" via package "XML::LibXML::El +ement" at -e line 1. $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +replaceText(55); print $q;" Can't locate object method "replaceText" via package "XML::LibXML::Ele +ment" at -e line 1. $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +appendText(55); print $q;" <q>55</q>
      $ perl -MXML::LibXML -le " $q = XML::LibXML::Element->new(q{q}); $q-> +removeChildNodes; $q->appendText(55); print $q;" <q>55</q>