cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Santoso, Tommy" <Tommy.Sant...@Dresdner-Bank.com>
Subject AW: How to determine the end of character data?
Date Wed, 06 Feb 2002 19:12:59 GMT
Hi Cocooners,

I have faced the same problems as described below, 
using I18nTransformer and think have fixed this problem.

Please feel free to double check/improve it.

Cheers,
Tommy

-----Urspr—Ćngliche Nachricht-----
Von: Piroumian, Konstantin [mailto:KPiroumian@flagship.ru]
Gesendet am: Dienstag, 5. Februar 2002 09:45
An: cocoon-dev@xml.apache.org
Betreff: Re: How to determine the end of character data?

> Piroumian, Konstantin wrote:
> > Hi, Cocooners!
> >
> > According to SAX API the parser is free to split the character data to
> > chunks. This causes problems in i18n transformer, which handles
character
> > data in the 'characters(char[] ch, int start, int length)' method.
> >
> > Is there a way to determine the end of the character data? The only
> > solution seems to be to buffer all the character data then handle it on
the
> > first startElement() event following the characters().
>
> Do you mean the next  endElement() event?
>
> > Will this be correct?
> >
>
> Then it should be correct.

Yes, of course it must be also the endElement(). But what about this
situation:

<text>
    This is a <b>bold</b> font.
</text>

Here is the sequence of events:
startElement("text")
    characters("Test is a ")*
    startElement("b")
        characters("bold")*
    endElement("b")
    characters("font")*
endElement("text")

*)maybe chunked

As you can see either startElement() or endElement() could happen.
Any ideas how to handle this correctly?

Konstantin

>
>
> Martin
>
> --
> Martin Holz  <holz@fiz-chemie.de>  phone: 0049-30-39977 218
> FIZ CHEMIE BERLIN
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

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


Mime
View raw message