sorry, but what's wrong in using it like this...

$xs = new XML::Parser; die ("Can't find file: $completePathFile $!") unless -f($completePat +hFile); $xs->setHandlers( Start => \&openElem, End => \&closElem, Char => \&heresTheData, Default => \&forgetit ); $xs->parsefile($completePathFile); ##now, parses and logic sub openElem{ } sub closElem{ } sub heresTheData{ } sub forgetit{ }
You have to activate a flipflop variable when you open the desired tag. And deactivate it when this tag closes.

In between, you are able to process the data that is received. Or waiting for other(s) flipflop(s) before processing the incoming data. You could leave it like this, and the file is going to parse perfectly ('though without any profit :).

For me, this module is a great masterpiece. But I only know this one, because it is the one more easyly found at any WWW site.


In reply to Re: Re: XML::Parser Style=>Subs and undefined subroutines by chanio
in thread XML::Parser Style=>Subs and undefined subroutines by rkg

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.