My xml file is
<?xml version="1.0" encoding="windows-1252"?> <IDList><Details><id>Trial ID</id><name>Mooza </name></Details><Details><id>Trial ID</id><name>bin_salim99 </name></Details><Details><id>Trial ID</id><name>dino88 </name></Details><Details><id>Trial ID</id><name>al3neeeeed </name></Details><Details><id>TrialID</id><name>Do0oDa</name></Details +></IDList>
   In this I want to add a new node in the last or want to edit the note or delete the node.

   I have read the values from the text file and write it in to xml. the code is
use XML::Writer; use XML::XPath; use XML::XPath::Node; use IO::File; open(NEW, "<<../main/idno.txt"); @id = <NEW>; close (NEW); my $output = new IO::File(">data9.xml"); my $doc = XML::Writer->new(OUTPUT => $output); $doc->xmlDecl("windows-1252"); $doc->startTag("IDList"); foreach (@id) { ($actid, $name) = split(/:/, $_); $doc->startTag( "Details" ); $doc->dataElement( id => $actid); $doc->dataElement( name => $name); $doc->endTag("Details"); } $doc->endTag("IDList"); # close IDList $doc->end(); # final checks $output->close();
Now I want to add a new child in the xml file or edit a node or delete the node. How i can do it and give some suggestions for that. If have any code send it.

In reply to Editing in xml by antovinraj
in thread Append in XML using perl 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.