cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: cvs commit: cocoon-2.1 status.xml
Date Sat, 06 Mar 2004 16:53:34 GMT
joerg@apache.org wrote:

>       public void characters(char[] ch, int start, int length) {
>   
>           if (ch.length > 0 && start >= 0 && length > 1) {
>  -            String text = new String(ch, start, length);
>               if (elementStack.size() > 0) {
>                   IndexHelperField tos = (IndexHelperField) elementStack.peek();
>  -                tos.appendText(text);
>  +                tos.appendText(ch, start, length);
>               }
>  -            bodyText.append(text);
>  +            bodyText.append(' ');
>  +            bodyText.append(ch, start, length);
>           }
>       }
>

What will happen when "keyword" text is streamed as two characters 
events, "key" and "word"? I think it will become "key word", and 
indexing will break.

IIUC, idea was to add a space in between tags, i.e. so 
<p>some</p><p>text</p> is not indexed as "sometext". If that's correct,

then better fix would be to add space only if boolean flag 
had_start_or_end_element_in_between_char_events set.


Vadim


Mime
View raw message