You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hugh Field-Richards <H.FIELD-RICHARDS> on 2004/02/04 16:56:41 UTC
Cocoon setting small buffer size in content stream
HI
Has anyone had a problem with cocoon chopping up the input content
stream into 32 byte chunks. I have this (and it seems to happen in a
fairly
indeterministic way) and it is causing me grief in my custom
transformers.
I have checked for obvious things like invisible characters, white-space
or other obvious causes but there is nothing obvious. It also chops up
the
incoming stream in the middle of words.
In a short chunk of contiguous character content (about 50 characters
long)
it chopped it up into three parts (9, 32 and 9 characters). The split
depends
on what has come before. Putting a trace on this it appears to work
fine earlier
in a pipeline, but then Cocoon seems to reset the buffer to 32.
The method that is being affected in the transformer is
public void characters( char[] buffer, int start, int length )
throws SAXException
{
...
}
This is then being called three times in the case above when it should
be only
called once. Is there a explicit buffer size that I can set somewhere?
Any help here will be very gratefully received.
Hugh F-R
Dr Hugh S. Field-Richards
Principle Scientist
QinetiQ, St Andrew's Road, Malvern, Worcs, WR14 3PS, UK
Tel: ++1684 895075 Fax: ++1684 896113
Email: h.field-richards@eris.qinetiq.com
The views expressed above area are entirely those of the writer and
do not represent the views, policy or understanding of any other
person or official body.
Re: Cocoon setting small buffer size in content stream
Posted by Joerg Heinicke <jo...@gmx.de>.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26219
Joerg
On 05.02.2004 09:25, Hugh Field-Richards wrote:
> It certainly looks as though it is the same bug. It is interesting that
> there
> was a suggestion of using concat() to force things. In another case that I
> had that certainly worked, but this is straight content from the XML
> stream.
>
> I have been unable to get a small, reliable enough example to submit a bug
> report. I know how I can work around it, but I just wonder when it is
> going to
> bite me again.
>
> Many thanks for the help
>
> Hugh F-R
>
> On 4 Feb 2004, at 16:27, Jorg Heymans wrote:
>
>> have a look at
>> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107418680806175&w=2
>>
>> You're probably hitting the same bug.
>>
>> Unknown wrote:
>>
>>> HI
>>> Has anyone had a problem with cocoon chopping up the input content
>>> stream into 32 byte chunks. I have this (and it seems to happen in a
>>> fairly
>>> indeterministic way) and it is causing me grief in my custom
>>> transformers.
>>> I have checked for obvious things like invisible characters, white-space
>>> or other obvious causes but there is nothing obvious. It also chops
>>> up the
>>> incoming stream in the middle of words.
>>> In a short chunk of contiguous character content (about 50 characters
>>> long)
>>> it chopped it up into three parts (9, 32 and 9 characters). The split
>>> depends
>>> on what has come before. Putting a trace on this it appears to work
>>> fine earlier
>>> in a pipeline, but then Cocoon seems to reset the buffer to 32.
>>> The method that is being affected in the transformer is
>>> public void characters( char[] buffer, int start, int length )
>>> throws SAXException
>>> {
>>> ...
>>> }
>>> This is then being called three times in the case above when it
>>> should be only
>>> called once. Is there a explicit buffer size that I can set somewhere?
>>> Any help here will be very gratefully received.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon setting small buffer size in content stream
Posted by Hugh Field-Richards <h....@eris.qinetiq.com>.
I am going to assume in all cases that this will be the case
and code suitably. Wrong assumptions on behaviour can
be bad for the health :-) Appending the data together is the
only solution and I should have done that in the first
place.
Thanks for all the help
Hugh F-R
On 5 Feb 2004, at 13:59, Matthias Stöckel wrote:
> Hi Hugh,
>
> this seems to be the default behavior of the SAX Parser.
> http://xml.apache.org/xerces-j/apiDocs/org/xml/sax/
> ContentHandler.html#characters(char[],%20int,%20int)
> I don't think that this is a bug. There can be several calls to the
> characters method between the startelement and end endelement method.
> Appending the characters from the different calls seems to be the only
> solution.
> Cheers
> Matthias
>
> Hugh Field-Richards wrote:
>> It certainly looks as though it is the same bug. It is interesting
>> that there
>> was a suggestion of using concat() to force things. In another case
>> that I
>> had that certainly worked, but this is straight content from the XML
>> stream.
>> I have been unable to get a small, reliable enough example to submit
>> a bug
>> report. I know how I can work around it, but I just wonder when it is
>> going to
>> bite me again.
>> Many thanks for the help
>> Hugh F-R
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon setting small buffer size in content stream
Posted by Matthias Stöckel <Ma...@fztig938.bank.dresdner.net>.
Hi Hugh,
this seems to be the default behavior of the SAX Parser.
http://xml.apache.org/xerces-j/apiDocs/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int)
I don't think that this is a bug. There can be several calls to the
characters method between the startelement and end endelement method.
Appending the characters from the different calls seems to be the only
solution.
Cheers
Matthias
Hugh Field-Richards wrote:
> It certainly looks as though it is the same bug. It is interesting that
> there
> was a suggestion of using concat() to force things. In another case that I
> had that certainly worked, but this is straight content from the XML
> stream.
>
> I have been unable to get a small, reliable enough example to submit a bug
> report. I know how I can work around it, but I just wonder when it is
> going to
> bite me again.
>
> Many thanks for the help
>
> Hugh F-R
>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon setting small buffer size in content stream
Posted by Hugh Field-Richards <h....@eris.qinetiq.com>.
It certainly looks as though it is the same bug. It is interesting that
there
was a suggestion of using concat() to force things. In another case
that I
had that certainly worked, but this is straight content from the XML
stream.
I have been unable to get a small, reliable enough example to submit a
bug
report. I know how I can work around it, but I just wonder when it is
going to
bite me again.
Many thanks for the help
Hugh F-R
On 4 Feb 2004, at 16:27, Jorg Heymans wrote:
> have a look at
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107418680806175&w=2
>
> You're probably hitting the same bug.
>
> Unknown wrote:
>
>> HI
>> Has anyone had a problem with cocoon chopping up the input content
>> stream into 32 byte chunks. I have this (and it seems to happen in a
>> fairly
>> indeterministic way) and it is causing me grief in my custom
>> transformers.
>> I have checked for obvious things like invisible characters,
>> white-space
>> or other obvious causes but there is nothing obvious. It also chops
>> up the
>> incoming stream in the middle of words.
>> In a short chunk of contiguous character content (about 50 characters
>> long)
>> it chopped it up into three parts (9, 32 and 9 characters). The split
>> depends
>> on what has come before. Putting a trace on this it appears to work
>> fine earlier
>> in a pipeline, but then Cocoon seems to reset the buffer to 32.
>> The method that is being affected in the transformer is
>> public void characters( char[] buffer, int start, int length )
>> throws SAXException
>> {
>> ...
>> }
>> This is then being called three times in the case above when it
>> should be only
>> called once. Is there a explicit buffer size that I can set somewhere?
>> Any help here will be very gratefully received.
>> Hugh F-R
>> Dr Hugh S. Field-Richards
>> Principle Scientist
>> QinetiQ, St Andrew's Road, Malvern, Worcs, WR14 3PS, UK
>> Tel: ++1684 895075 Fax: ++1684 896113
>> Email: h.field-richards@eris.qinetiq.com
>> The views expressed above area are entirely those of the writer and
>> do not represent the views, policy or understanding of any other
>> person or official body.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon setting small buffer size in content stream
Posted by Jorg Heymans <jh...@domek.be>.
have a look at
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107418680806175&w=2
You're probably hitting the same bug.
Unknown wrote:
> HI
>
> Has anyone had a problem with cocoon chopping up the input content
> stream into 32 byte chunks. I have this (and it seems to happen in a fairly
> indeterministic way) and it is causing me grief in my custom transformers.
> I have checked for obvious things like invisible characters, white-space
> or other obvious causes but there is nothing obvious. It also chops up the
> incoming stream in the middle of words.
>
> In a short chunk of contiguous character content (about 50 characters long)
> it chopped it up into three parts (9, 32 and 9 characters). The split
> depends
> on what has come before. Putting a trace on this it appears to work fine
> earlier
> in a pipeline, but then Cocoon seems to reset the buffer to 32.
>
> The method that is being affected in the transformer is
>
> public void characters( char[] buffer, int start, int length )
> throws SAXException
> {
> ...
> }
>
> This is then being called three times in the case above when it should
> be only
> called once. Is there a explicit buffer size that I can set somewhere?
>
> Any help here will be very gratefully received.
>
> Hugh F-R
>
>
> Dr Hugh S. Field-Richards
> Principle Scientist
> QinetiQ, St Andrew's Road, Malvern, Worcs, WR14 3PS, UK
> Tel: ++1684 895075 Fax: ++1684 896113
> Email: h.field-richards@eris.qinetiq.com
>
> The views expressed above area are entirely those of the writer and
> do not represent the views, policy or understanding of any other
> person or official body.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org