Hello,

i am currently working on support for white-space-treatment and
linefeed-treatment for the RTF module. Of course i don't want to reinvent
the wheel, so i tried wanted Block.handleWhiteSpace method to do the job.

But when i read the text data which is passed to RtfHandler.characters there
is no support for white-space-treatment and linefeed-treatment. The
handleWhiteSpace method seems to process the text data at later time.

If i loop through Block.children in RtfHandler.endBlock and look for FOText
objects the text data is processed correctly. But unfortunately i need the
text data in RtfHandler.characters - in RtfHandler.endBlock it's to late.

I see following possibilities to solve this problem:

(1) I re-implement support for white-space-treatment and linefeed-treatment
in the RTF module and call this algorithm from RtfHandler.characters -
independend of Block.handleWhiteSpace. (IMHO not a good idea)

(2) I defer the processing of all inline-generating, text-containing FOs,
and process them in RtfHandler.endBlock. (Maybe it could be difficult to
determine when to defer processing and when not. For example i'll have to be
carefull with nested fo:block's. Quite difficult.)

(3) I defer the processing of all FOs until endPageSequence, and then loop
recursively through all children and call startXXX and endXXX events
explicitly. (Maybe the best solution. On one hand this would be a quite big
revolution for just two properties, on the other hand maybe there are
similar issues in future.)

Any comments or opinions appreciated.

Kind regards
Peter Herweg


Reply via email to