in reply to problem with XML::Parser

Yes, everyone has the same problem. It's documented: A single non-markup sequence of characters may generate multiple calls to this handler (from the doc of the Char handler).

You need to buffer the text in the Char handler, and use it when you get to the next tag. See XML::Parser for more info.

Replies are listed 'Best First'.
Re^2: problem with XML::Parser
by Paulux (Acolyte) on Jun 19, 2009 at 07:27 UTC
    I'm a perl newbie, how i can buffer it? Any suggestion? B/R

      Err... did you follow the link I gave? The part entitled "Getting all the character data" describes buffering. Note that if you don't have to deal with mixed content, then you don't need to process characters within the Start handler.

      BTW, if you have just started development, I would second Jenda's advice and use (his) XML::Rules or (my!) XML::Twig, or if libxml2 is available, XML::LibXML, even though neither of us wrote it ;--)