Keiron Liddle wrote: > > Jeremias Maerki wrote: > > > > > Anyway, may I ask for the reason that you want to do that? > > > > Sure. I am trying to port some code I wrote to implement > text-transform for > > the maintenance branch over to the trunk. One of the key things > there is to > > tie together all FOText objects that are part of the same Block, so that > > word boundaries are respected regardless of the markup. The way I > > implemented this was to keep finding ancestors until I came to > a Block. I > > can't do that without the reference to the parent. It is not a > high priority > > thing, but I am trying to finish up all of the stuff I started in the > > maintenance branch. > > Should've read this earlier. > > This sounds more like a layout thing. > If you are going to find complete words to do some manipulation > then I would > suggest taking a look at the "getWordChars" method in the layout > managers. This > is used to gather together all strings in from different layout > managers, eg. when > there is a inline fo. At the moment it is meant for hyphenation. > The exact implementation for this may change but that is the general idea.
I looked at the layout classes & did not find what I needed. I decided to go ahead & implement the text-transform in FOText, and have committed that change. There is a test document that I placed in the repository some time ago, and the committed code handles all of those tests fine, including Joerg's nested wrappers. Oleg actually wrote quite a bit of this code. The only insight I added was where to run it & how to tie the FOText objects together, and as Keiron has pointed out, there may yet be a better place to do this. If so, I will adjust it later. Other issues: 1. I use a static variable in FOText (lastFOTextProcessed). I do not know of a good way around this until we resolve where to put document- and session- level stuff. This particular variable belongs to the document. I thought about using the fo.Root object for this, and that may be a good idea. However, you either need to pass the reference to it around, or compute it (by going up the fo tree until you find it). Jeremias & I got bogged down in how this should work, and we probably need to revisit it. I haven't been able to spend enough time with Avalon yet to see how it helps us with this. 2. There may be some i18n issues. All of my testing has been for English. The actual conversion all uses the Java routines, and I don't expect any trouble there. The tricky stuff is how to define where a word starts, and that may require some future work. Victor Mote --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]