I am trying to parse an xml file (sample input and out put below).I have some sample code written below,not sure how to proceed,I have the sample input xml file and the output.Please advise

Input XML file:- <build> <name>lpass</name> <build_id>M8960AAAAANAAL1004</build_id> <windows_root_path cmm_root_path_var="PASS_BUILD_ROOT">\\TEST\M9 +650AAAAANAAL1004\</windows_root_path> <linux_root_path cmm_root_path_var="PASS_BUILD_ROOT"/> <image_dir>lpass_proc</image_dir> <fat_file> <build> <name>rpm</name> <build_id>M8960AAAAANAAR1004</build_id> <windows_root_path cmm_root_path_var="PM_BUILD_ROOT">\\TEST\M965 +0AAAAANAAR1004\</windows_root_path> <linux_root_path cmm_root_path_var="PM_BUILD_ROOT"/> <image_dir>rpm_proc</image_dir> <download_file> <file_name>rpm.mbn</file_name> <file_path>rpm_proc/</file_path> </download_file> </build> <build> <name>wcnss</name> <build_id>M8960AAAAANAAW1004</build_id> <windows_root_path cmm_root_path_var="NSS_BUILD_ROOT">\\TEST\M96 +50AAAAANAAW1004\</windows_root_path> <linux_root_path cmm_root_path_var="NSS_BUILD_ROOT"/> <image_dir>wcnss_proc</image_dir> OUTPUT should be:- PASS_BUILD_ROOT \\TEST\M9650AAAAANAAL1004 PM_BUILD_ROOT \\TEST\M9650AAAAANAAR1004 NSS_BUILD_ROOT \\TEST\M9650AAAAANAAW1004 CURRENT CODE:- use strict; use warnings; use Getopt::Long; use File::Glob (); my %options=(); GetOptions (\%options,'loc=s'); #print "\n$options{loc}"; my $contents_xml = glob(($options{loc} . '\\contents.xml')); #print "\n$contents_xml";

In reply to Parsing an xml file by Anonymous Monk

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.