January 10, 2009

More XSL page layouts

Filed under: Uncategorized — John Walkup @ 9:20 pm

Let’s go back to the earlier XSLT document from my previous blog. For the purposes of this discussion, we will focus on only one page master for brevity. Note that in the example below, I have set the top margin to 20 points in two different locations: one in the page master declaration, and the other in the region body declaration.

<xsl:template match=”sales”>
<fo:root>
<!– layout-master (page setup) –>

<fo:layout-master-set>
<fo:simple-page-master master-name=”body” margin-top=”20pt”>
<fo:region-body region-name=”portrait” margin-top=”20pt”/>
</fo:simple-page-master>
</fo:layout-master-set>

<!– page sequence (containts page content) –>

<fo:page-sequence master-reference=”body”>
<fo:flow flow-name=”portrait”>
<fo:block>
<xsl:apply-templates select=”truck”/>
</fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>
</xsl:template>

The effects of the two margin spacings are cumulative: the resulting document has a 40 point top margin spacing. What is going on here? And since only one region body can be declared within a given page master, why would XSL allow a margin spacing command to be placed in both? Which is preferable? Is there ever any difference between one and the other?

Evidently, I need to explore this issue further, but later. I have gotten away from my earlier goal of understanding the relationship between template matches and FO layouts.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress