xsl-list
[Top] [All Lists]

Re: [xsl] XSL:FO approach for facing-page translation

2014-02-07 13:27:25
The only way I can think of to do this would be a multi-pass process that
operates on the intermediate area tree. If you emitted both language
streams as separate flows, one for verso pages and one for recto pages,
where you included IDs on blocks to allow you to correlate the two
language versions, you could then examine the area tree to see for each
pair which was deeper and set the vertical extent of the corresponding
block to match. Re-rendering the two flows should then result in them
being properly synchronized.

See Tony Graham's paper from last year's Balisage for implementation
guidance: 
http://www.balisage.net/Proceedings/vol10/html/Graham01/BalisageVol10-Graha
m01.html

Cheers,

Eliot
-- 
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.reallysi.com
www.rsuitecms.com




On 2/7/14, 12:43 PM, "Martin Holmes" <mholmes@uvic.ca> wrote:

Hi all,

I have an interesting problem to solve with an edition of a source text
which has an accompanying translation.

The text is in paragraphs, with each paragraph in the original matching
one in the translation. In XHTML, I'm easily able to render the two
texts in a borderless table, with a row for each paragraph, giving a
nice readable parallel-text view.

I need to do something similar in PDF, using XSL:FO. The ideal would be
to have the original text on the verso page, with the equivalent
translation on the facing recto. But I can't figure out a practical
approach to this. For one thing, I don't see how I can render individual
pages from one text and then the other text in alternating fashion, and
for another, I don't see any way to keep the two texts in sync. I can
disallow page-breaks within paragraphs, but I'd have to be
extraordinarily lucky for the two texts to end up breaking at the same
points every time; it would just take one slightly-shorter paragraph on
one side to put them out of sync by a paragraph. Such a strategy would
also be rather a paper-waster, because many pages would have a lot of
blank space at the bottom.

Has anyone every done anything like this, and if so, do you have any
advice? I can imagine that it might be done in a horribly manual fashion
by trial and error, working page-by-page, but I really don't want to get
into that. I'm happy to pre-process the text multiple times before it
goes to the XSL:FO stage., Perhaps there are ways to measure (for
instance) how much space a paragraph will take, and then adjust
page-margins or spacing by small increments to preserve alignment
between the two texts, but I haven't seen examples of such an approach.

All advice much appreciated.

Cheers,
Martin


--+AH4-------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@lists.mulberrytech.com>
--+AH4---



--+AH4-------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+AH4---