Subject: [xsl] Seperating Heading from Content|
From: "Struijk, Toon van der" <aecvanderstruijk@xxxxxxxxx>
Date: Mon, 7 Nov 2011 19:17:25 +0100
Hi all, I'm (still) a newby in XSL-FO. So the answer to my question may be common knowledge to the most of you, but to me it's mindboggling. What I try to achieve is the following: In a very standard PDF publication I want the 'body' content always appear at the same height on every page. But part of this content is a H2 heading (yes, I'm in the process of transforming xHTML data to a nicely styled PDF). I have set up all pages according to the client's specs (the 'fo:layout-master-set'), and now I'm defining the individual page sets, including the one where the 'body' goes into (<fo:flow flow-name="xsl-region-body">). And there it doesn't go the way I want it. Because the 'H2' is part of the body, I don't know of a way how to 'seperate' this from the rest of the content. I want the 'H2' (whenever it is available) always appear at the top of the page with a distance of 45mm from the top. The rest of the body I want to appear at 65mm from the top, always no matter if it is preceeded with a 'H2' or not. To be more specific: When in the body a 'H2' is encountered, I put it on new page ('page-break-before="always"' in the '<xsl:template match="h2">' definition) 45mm from the top, and after that the rest of the body (content) appears 20 mm (65mm from the top) after the 'H2'. But that content spans more then one page. And I want that content (without any 'H2') on the other pages to appear at the same height as on the page where it started after the 'H2'; 65mm from the top. To be more visual; every 'H2' must be positioned above the rest of the flowing body content. How can I accomplish that? Any help or suggestion would be appreciated. Met vriendelijke groet, Toon van der Struijk Art Director Elektronicaweg 31 2628 XG Delft, Nederland T +31 (0)15 - 251 37 00 F +31 (0)15 - 251 37 01 M +31 (0)6 - 1309 0937 E aecvanderstruijk@xxxxxxxxx Op dit mailbericht is onze disclaimer van kracht.