Re: [xml] crash in charactersSAXFunc
- From: Matt Sergeant <matt sergeant org>
- To: Adrian Feiguin <feiguin magnet fsu edu>
- Cc: "xml gnome org" <xml gnome org>
- Subject: Re: [xml] crash in charactersSAXFunc
- Date: Mon, 4 Jun 2001 05:32:36 +0100 (BST)
On Sun, 3 Jun 2001, Adrian Feiguin wrote:
My program uses the SAX interface to parse an encoded image, lets say
that I'm using base64 encoding.
The charactersSAXFunc callback
returns a string with all the character between tags, and I want to use
it to reconstruct the original image. If the string
is too long (apparently len = 1000), my program crashes.
Can anybody tell me what's wrong? How can I overcome this?
An XML parser isn't guaranteed to return the entire contents of a tag in a
characters callback. It is free to break on every byte, or newlines, or
entities, or...
So your application is most likely expecting all the base64 string, but
only getting part of it. Use a buffer to bundle it all together, and
process the string in the call to end_element.
--
<Matt/>
/|| ** Founder and CTO ** ** http://axkit.com/ **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** mod_perl news and resources: http://take23.org **
\\//
//\\
// \\
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]