[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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

Subject: Re: [xsl] XSL:FO approach for facing-page translation
From: Eliot Kimber <ekimber@xxxxxxxxxx>
Date: Fri, 7 Feb 2014 13:27:04 -0600

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


Eliot Kimber
Senior Solutions Architect
+ACI-Bringing Strategy, Content, and Technology Together+ACI-
Main: 512.554.9368

On 2/7/14, 12:43 PM, +ACI-Martin Holmes+ACI- +ADw-mholmes+AEA-uvic.ca+AD4-

+AD4-Hi all,
+AD4-I have an interesting problem to solve with an edition of a source text
+AD4-which has an accompanying translation.
+AD4-The text is in paragraphs, with each paragraph in the original matching
+AD4-one in the translation. In XHTML, I'm easily able to render the two
+AD4-texts in a borderless table, with a row for each paragraph, giving a
+AD4-nice readable parallel-text view.
+AD4-I need to do something similar in PDF, using XSL:FO. The ideal would be
+AD4-to have the original text on the verso page, with the equivalent
+AD4-translation on the facing recto. But I can't figure out a practical
+AD4-approach to this. For one thing, I don't see how I can render individual
+AD4-pages from one text and then the other text in alternating fashion, and
+AD4-for another, I don't see any way to keep the two texts in sync. I can
+AD4-disallow page-breaks within paragraphs, but I'd have to be
+AD4-extraordinarily lucky for the two texts to end up breaking at the same
+AD4-points every time+ADs- it would just take one slightly-shorter paragraph
+AD4-one side to put them out of sync by a paragraph. Such a strategy would
+AD4-also be rather a paper-waster, because many pages would have a lot of
+AD4-blank space at the bottom.
+AD4-Has anyone every done anything like this, and if so, do you have any
+AD4-advice? I can imagine that it might be done in a horribly manual fashion
+AD4-by trial and error, working page-by-page, but I really don't want to get
+AD4-into that. I'm happy to pre-process the text multiple times before it
+AD4-goes to the XSL:FO stage., Perhaps there are ways to measure (for
+AD4-instance) how much space a paragraph will take, and then adjust
+AD4-page-margins or spacing by small increments to preserve alignment
+AD4-between the two texts, but I haven't seen examples of such an approach.
+AD4-All advice much appreciated.
+AD4-XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
+AD4-To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
+AD4-or e-mail:

Current Thread