Good Morning Monks, I know this question is already asked in this forum but i cant able to understand. Here is my code
sub start { @tempArray=0; #our $filename=shift; our $parser = new XML::DOM::Parser; our $doc = $parser->parsefile("1597976.doc001.out.xml") or die "Un +able to parse document"; our $root = $doc->getDocumentElement(); valueIntoArray($root); } sub valueIntoArray #Placing values alone into array { my ($rt)= @_; foreach my $node ( $rt->getChildNodes()) { if (($node->getNodeType() == TEXT_NODE ) && ($node->getData()= +~ /\S/s)) { #push(@tempArray,lc($node->getData())); print $node->getData()."\n"; } valueIntoArray($node); } #return sort(@tempArray); }
My goal is to retrieve all the value from XML file excluding tags.It works well.But now i want retrieve values from particular area.Consider the XML file is like
<Person> <Address> <name>xxx</name> <mobile>xxx</mobile> </Address> <Education> <Degree>xxx</Degree> <Major>xxx</Major> </Education> </Person>
.Here i want to retrieve only values under Education tag.How can i do that.Education tags contain various tags depending upon input.So i cant go by tag name.Please help me

In reply to Regarding XML::DOM::Parser by mecrazycoder

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.