Hi Dear Monks,
I am very new to the XML data manipulation using Perl, some process will generate the iprocess XML, in which few values are not populated correctly, Due to this client are editing this xml manually by using the properties file. I need to automate this task by using the Perl. I don't have any prior experience for this task.Below is the detail description of task which i need to complete.
The input for editing the XML is properties file, in which the lines starts with M_R signifies replacement of the values for those attributes which are existed in XML and M_A are the lines for which i need to add new nodes in the XML. Below it the properties file content and the XML which i need to modify based on the properties file.

#Below is the Properties file content M_R_xxxx/nodes/Application = test123 M_R_params/nodes/Environment = test M_R_Params/Debug/log = /admin/test/xxxx/yyyy/at/domain/test123-uat/app +lication/logs/a.log M_R_/nodes/srv/new/build/binding/machine = tesing.com M_A_/app/ser/ada/bind/bin/host = google.com M_R_/ap/ser/mn/bin/bin/product/ver = 1.2.3 M_R_/app/serv/SN/bind/bin/set/perl/size = 566 M_A_/appl/ser/CN/bind/bin/set/perl/Path = /xxxx/APP/app1/alter/value M_A_/appn/ser/XT/bind/bin/set/perl/Path = /new/test/app/minor/test123 M_R_/applx/serx/NT/bind/binding/down/time = 30 M_R_/appl/serv/PT/context/test/no = 25 M_R_/appl/ser/XT/gate/clear/state = false

The XML file which i need to modify based on the above properties file is as below.
<?xml version="1.0" encoding="UTF-8"?> <list> <entry> <name><first>Thadeus</first><last>Wrigley</last></name> <phone>716-505-9910</phone> <address> <street>105 Marsupial Court</street> <city>Fairport</city><state>NY</state><zip>14450</zip> </address> </entry> <entry> <name><first>Jill</first><last>Baxter</last></name> <address> <street>818 S. Rengstorff Avenue</street> <zip>94040</zip> <city>Mountainview</city><state>CA</state> </address> <phone>217-302-5455</phone> </entry> <entry> <name><last>Riccardo</last> <first>Preston</first></name> <address> <street>707 Foobah Drive</street> <city>Mudhut</city><state>OR</state><zip>32777</zip> </address> <phone>111-222-333</phone></entry> <entry> <address> <street>10 Jiminy Lane</street> <city>Scrapheep</city><state>PA</state><zip>99001</zip> </address> <name><first>Benn</first><last>Salter</last></name> <phone>611-328-7578</phone> </entry> </list>
From long time i am going through the threads which are related to XML in Perl monks,based on posts in perl monks i have installed XML::Parser,XML::libXML, based on the examples in the thread i could able to parse the XML but not able to achieve the task what actually its needed to accomplish this task.
I have started to read the O'REILLY Perl and XML PDF book which i have downloaded from Net, but this may take time for me to gain some knowledge on this.Experts monks could you please consider this post and consider it's an humble and very kind request from me to give your valuable inputs for me to get start with this task.

In reply to How to replace the existing values and to add the new nodes which are not existed based on the properties file by perladdict

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.