in reply to Out of memory with XML::Parser

I am not sure what the bug is, and if it is related to the bug runrig pointed at. One thing you could try: trace (or use the debugger if you can) what's in the second argument of the Char handler. Is it really the string you are looking for?

Replies are listed 'Best First'.
Re^2: Out of memory with XML::Parser
by LukeyBoy (Friar) on Sep 14, 2005 at 20:36 UTC
    Strange, the character data being returned is waaaay too large for the object in question. The object is a base64-encoded JPEG in this case and is about 50k of data, yet the Char subroutine is fired way more times than there is lines of data in the XML for that object. I'll keep poking around.

      Now we are getting somewhere.

      Try looking at $expat->recognized_string or at $expat->original_string, see if they have what you are looking for on the first call to the Char handler.

      Is the data in regular (PCDATA) text, or is it in a CDATA section?

        OK, I've done that for the element that's being problematic. It seems to just keep firing the character data sub over and over, and the expected and original strings always match (and always appear to be Base64-encoded data). The data is PCDATA, not CDATA. Should I try using CDATA?