cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <>
Subject Re: characters() strange behavior
Date Thu, 19 Aug 2004 10:05:45 GMT
On Thu, 19 Aug 2004 10:54:54 +0200 (MEST), Halgurt Mustafa-Ali
<> wrote:
> Hi,
>  I had a look at the cocoon API to find out how the method "Characters" I found
>  this section below:
>  c should be the whole characters of the xml document, but when I have documents
>  who have more characters than 2048 I get only the first 2048 and the rest will
>  be cut. Can somebody give me an explanation?

A good read at the SAX API should clarify your problem. the characters
will be sent you as an unspecified number of characters() calls to
your handler, so you are probably missing the second one (your parser
is doing 2048 chars chunks).

Mind you, pay special attention to the "start" and "len" parameter:
the char array can be reused so that if a first event sends you
"greetings" and the next one sends you "world", the first array will

g r e e t i n g s

and the second one could be
w o r l d i n g s

or even

g r e e w o r l d

or, why not,

g r w o r l d g s

I'm not saying this is happening (well, the first and secondd scenario
are, actually), but the spec explicitely say it might.


Gianugo Rabellino

View raw message