You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Tejbir Singh <si...@india.hp.com> on 2003/11/27 15:14:00 UTC

Buffer Overflow

 
Hi
     I am facing a particular problem. If the sizeof  the content of a
any element increases beyond 2k , sax automatically splits the content
into 2 strings. Anyone has any idea how to over come this. i.e how can
we increase the buffer size or any other solution.
 

Thanks
Tejbir Singh


 


Re: Buffer Overflow

Posted by Michael Glavassevich <mr...@apache.org>.
Hi Tejbir,

There is a property you can set on the parser which allows you to control
the buffer size [1] used by the parser. This is however no guarantee, that
the parser won't split the content into multiple 'characters' callbacks.
The parser will also split the callbacks when it encounters a newline.

SAX allows parsers to split character data [2] into as many chunks as they
please and on whatever boundaries they please. The application using SAX
is responsible for accumulating the text, so your code must handle this.

[1] http://xml.apache.org/xerces2-j/properties.html#input-buffer-size
[2] http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int)

On Thu, 27 Nov 2003, Tejbir Singh wrote:

>
> Hi
>      I am facing a particular problem. If the sizeof  the content of a
> any element increases beyond 2k , sax automatically splits the content
> into 2 strings. Anyone has any idea how to over come this. i.e how can
> we increase the buffer size or any other solution.
>
>
> Thanks
> Tejbir Singh

---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org