- From: Robin Harvey <rh@harrogatesoftware.com>
- Date: Mon, 8 Sep 2003 16:51:41 +0100
- To: "W3C XSL-FO Mailing list" <www-xsl-fo@w3.org>
Hi. I'm new to xsl-fo, and was getting on just fine before i ran in to this brick wall. I have a long list of data in XML that i want to format into a book. The data needs to flow in 3 columns, and all 3 colunms need to be broken by headings, like so: heading 1 1 4 7 2 5 8 3 6 heading 2 1 6 11 2 7 12 3 8 13 4 9 14 5 10 etc. I've found a way of flowing in 3 columns, but the headings appear in the columns, like this: heading1 5 1 1 6 2 3 7 3 4 8 4 4 heading2 I've tried using separate tables for the headings and the data, with a number-columns-spanned="3" in the table holding the heading, but it made no difference. I also tried using separate rows for the header and the data, but again it made no difference. I think what i need to do is have a nested flow within the main "xsl-region-body" flow, to hold the heading and stop it flowing with the rest of the data, but i can't find how to do this. Can someone help me please? Is it possible to nest flows within the same document, or am i missing a trick?? Here is a listing of the xsl stylesheet i am using. I am using Sablotron XSLT parser and FOP XSL-FO PDF generator. <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="data_main" page-width="21cm" page-height="29.7cm"> <fo:region-body column-count="3" column-gap="0.3in" margin="1in"/> <fo:region-before extent="0.9in"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="data_main"> <fo:static-content flow-name="xsl-region-before"> <fo:block text-align="center" font-family="Times" font-size="10"> <fo:page-number/> </fo:block> </fo:static-content> <fo:static-content flow-name="xsl-footnote-separator"> <fo:block> <fo:leader leader-pattern="rule" leader-length="100%" rule-thickness="0.5pt" color="#007044"/> </fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body"> <xsl:for-each select="/root/specialty"> <!-- THIS TABLE FOR THE HEADER - DOESNT SPAN 3 COLUMNS --> <fo:table table-layout="fixed"> <fo:table-column column-width="136px"/> <fo:table-body> <fo:table-row> <fo:table-cell number-columns-spanned="3" border-style="solid"> <fo:block space-before="18pt" font-family="sans-serif" font-size="16pt" line-height="18pt" text-align="center"> <xsl:value-of select="@name"/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> <fo:wrapper text-align="start"> <fo:table table-layout="fixed"> <!-- THIS TABLE FOR THE DATA - FLOWS IN 3 COLUMNS OK --> <fo:table-column column-width="136px"/> <fo:table-body> <fo:table-row> <fo:table-cell border-style="solid"> <xsl:for-each select="consultant"> <fo:block space-before="9pt" font-family="sans-serif" font-size="12pt" line-height="16pt" background-color="blue" color="white" text-align="center"> <xsl:value-of select="title"/> <xsl:text> </xsl:text> <xsl:if test="fnames != ''"> <xsl:value-of select="fnames"/> <xsl:text> </xsl:text> </xsl:if> <xsl:value-of select="snames"/> </fo:block> <fo:block space-before="4pt" font-family="sans-serif" font-size="8pt"> Consultant in <xsl:value-of select="spec_desc"/> </fo:block> <xsl:if test= "spec_int != ''"> <fo:block space-before="4pt" font-family="sans-serif" font-size="8pt" keep-together.within-column="always"> <fo:inline font-style="italic">Special Interests: </fo:inline> <xsl:value-of select="spec_int"/> </fo:block> </xsl:if> </xsl:for-each> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:wrapper> </xsl:for-each> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> Thanks in advance for any assistance. Robin Harvey p.s. - i've had to make extensive use of <xsl:for-each> because when i used 'external' templates i got name space errors popping up (in sablotron). Is there any way of transfering the fo namespace into a second (or third) template??
Received on Monday, 8 September 2003 12:22:32 UTC