Jacob,
Jacob Bager wrote:
Hi ...
I know this is a very stupid question, but after browsing the net for a tutorial, Working for me, with NO luck at all. I have to ask here.
This it what i wanna do..
(Im using the xsl:fo on a tomcat/cocoon installation., Just for a notice.)
I have created an XML.file located at http://approveone.phaseone.com/pdf/20030124210359.xml , To make it easy for me too, print to a pdf. I created it like so -document -page -table -row -cell -cell -cell -/row Etc..... A table with 3x3, with page breaks foreach page.
You'll have to figure out the rest, but here's more of a start than I got. Hope this helps!
Web Maestro Clay
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<xsl:apply-templates select="doc"/>
</xsl:template>
<xsl:template match="doc">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- defines page layout -->
<fo:layout-master-set>
<fo:simple-page-master master-name="repeating" page-height="28cm" page-width="22cm" margin-top="1cm" margin-bottom="1.3cm" margin-left="1cm" margin-right="1cm">
<fo:region-body margin-bottom="6.5cm" margin-top="7.6cm"/>
<fo:region-before extent="7.6cm"/>
<fo:region-after extent="6.5cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="repeating_pm">
<fo:repeatable-page-master-reference master-name="repeating"/>
</fo:page-sequence-master>
</fo:layout-master-set>
<!-- DEFINE PAGE SEQUENCE - repeating -->
<fo:page-sequence master-reference="repeating">
<fo:static-content flow-name="xsl-region-before">
<fo:block padding="0pt" xsl:use-attribute-sets="attNormal">
<xsl:call-template name="tmpHeader"/>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block xsl:use-attribute-sets="attNormal">
<xsl:call-template name="tmpFooter"/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:call-template name="tmpBody"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<!-- REGION-BEFORE: tmpHeader TEMPLATE -->
<xsl:template name="tmpHeader">
<fo:block padding="0pt">
<!-- REGION-BEFORE (Header) CONTENT -->
</fo:block>
</xsl:template>
<!-- REGION-AFTER: tmpFooter TEMPLATE -->
<xsl:template name="tmpFooter">
<fo:block padding="0pt">
<!-- REGION-AFTER (Footer) CONTENT -->
</fo:block>
</xsl:template>
<!-- REGION-BODY: tmpBody TEMPLATE -->
<xsl:template name="tmpBody">
<fo:block padding="0pt">
<!-- REGION-BODY (Body) CONTENT -->
<xsl:call-template name="tmpTable"/>
</fo:block>
</xsl:template>
<xsl:template name="tmpTable">
<fo:block padding="0pt">
<fo:table border="0pt" table-layout="fixed" margin-top="4pt">
<fo:table-column column-width="5cm"/>
<fo:table-column column-width="5cm"/>
<fo:table-column column-width="5cm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 1
</fo:block>
</fo:table-cell>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 2
</fo:block>
</fo:table-cell>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 3
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 1
</fo:block>
</fo:table-cell>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 2
</fo:block>
</fo:table-cell>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 3
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 1
</fo:block>
</fo:table-cell>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 2
</fo:block>
</fo:table-cell>
<fo:table-cell padding="1pt">
<fo:block keep-with-next.within-page="always">
Cell 3
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
</xsl:stylesheet>
-- Clay Leeds - [EMAIL PROTECTED] Web Developer - Medata, Inc. - http://www.medata.com PGP Public Key: https://mail.medata.com/pgp/cleeds.asc
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
