Hi there, I am fairly new to Perl and I've been assigned to do something very complex in a short period of time. A small part of my job is to write a Perl script that automatically adds a new release tab to the Hudson Build server each time we branch to a new release. Hudson uses the following config xml file and generates a GUI with fancy View tabs that list all our release projects. Can some one please help me write a Perl script that is able to add xml code to the following xml file by feeding it just the new release name(Tab Names in the xml file), and the script adds similar Tabs to Hudson that will contain all projects (zip and zip1) listed under the Tab 1, 2 and 3 with new names accordingly. (ex: Tab 4, 5 and 6). In addition, I also need to be able to remove these View Tabs when necessary. If anyone can help me get started on this, it will be much appreciated. Do I use "use XML::DOM;"? Thanks, Tony.
<views> <listView> <owner reference="../../.."/> <jobNames class="tree-set"> <comparator class="hudson.util.CaseInsensitiveComparator"/> <string>zip</string> </jobNames> <name>Tab1</name> </listView> <listView> <owner reference="../../.."/> <jobNames class="tree-set"> <comparator class="hudson.util.CaseInsensitiveComparator" refe +rence="../../../listView/jobNames/comparator"/> <string>zip1</string> </jobNames> <name>Tab2</name> </listView> <listView> <owner reference="../../.."/> <jobNames class="tree-set"> <comparator class="hudson.util.CaseInsensitiveComparator" refe +rence="../../../listView/jobNames/comparator"/> <string>zip</string> <string>zip1</string> </jobNames> <name>Tab3</name> </listView> </views> <slaveAgentPort>0</slaveAgentPort> <secretKey>6afc684a9a6f353335bd0f68beccc999f3adc88cac</secretKey> </hudson>

In reply to Removing and Appending to an XML file by payam77

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.