Hi,
Good Evening. I am using the xpath in my program and i an retrive and update the values. But I am unable to save the file. I have attached the code bellow.

use XML::XPath; $name = "Vinodh"; my $file = '../main/memlist.xml'; my $xp = XML::XPath->new(filename=>$file); my $nodeset = $xp->find("/MEMBERLIST/LIST[NICK='$name']/ROWID"); $data = $xp->getNodeText("/MEMBERLIST/LIST[NICK='$name']/NICKID"); print $data; $val = "9999"; $xp->setNodeText("/MEMBERLIST/LIST[NICK='$name']/NICKID",$val);

My Xml file is

<?xml version="1.0" encoding="Windows-1252"?> <MEMBERLIST> <LIST><NICK>0</NICK><ROWID>100</ROWID><NICKID>12545</NICKID><RANK>9</R +ANK></LIST> <LIST><NICK>007</NICK><ROWID>101</ROWID><NICKID>10125</NICKID><RANK>5< +/RANK></LIST> <LIST><NICK>Vinodh</NICK><ROWID>102</ROWID><NICKID>12498</NICKID><RANK +>18</RANK></LIST> <LIST><NICK>0P</NICK><ROWID>103</ROWID><NICKID>5472</NICKID><RANK>4</R +ANK></LIST> </MEMBERLIST>

U tell how to save the document in the file
Thanks & Advance Wishes

20060814 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips


In reply to How to save a XML File using XPath by antovinraj

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.