Hi...
I can find in a xml file some tags. To do this i use the following script:
#!C:/server/Perl/bin/perl.exe use strict; use XML::Parser; my $parser = new XML::Parser(ErrorContext => 2); $parser->setHandlers(Char => \&char_handler, Default => \&default_handler); $parser->parsefile('xml_teste1.xml'); sub char_handler { # This is just here to reduce the noise seen by # the default handler } # End of char_handler sub default_handler { my ($p, $data) = @_; if ($data =~ /^Entity id/) { my $line = $p->current_line; $data =~ s/\n/\n\t/g; print "$line:\t$data\n"; } } # End of default_handler
This script find the tags that i can. But i need the content between the tags.
Someone can help me?

Title edit by tye


In reply to XML::Parser ignoring content between tags? by aroso

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.