in reply to Re^2: Add New Attribute to XML
in thread Add New Attribute to XML

Looking at the Source of XML::XPath::Node, there is the insertAfter method for nodes, which you can use to append other nodes after an existing node. But it doesn't seem like XML::XPath is geared towards XML manipulation. You're likely better off using one of the other XML modules. Potentially, XML::LibXML is geared towards both, XPath and DOM manipulation.

Replies are listed 'Best First'.
Re^4: Add New Attribute to XML
by Sun751 (Beadle) on Jun 22, 2009 at 08:29 UTC
    Can you suggest me some basic tutorial about XML::LibXML!!! Cheers!

      I'm under the impression that XML::LibXML mostly follows the W3C DOM API, so I assume that most of the documentation for the W3C DOM API applies to XML::LibXML. I'm not aware of any tutorials geared towards XML::LibXML specifically. The XML module that has the best documentation is XML::Twig.

Re^4: Add New Attribute to XML
by Sun751 (Beadle) on Jun 22, 2009 at 12:42 UTC
    Could any one suggest me how can i use XML::LibXML to achieve my target? as in above code i am trying to check if the attribute exists in hash, if not add new attribute!!! any suggestion!!! Cheers