- From: Kaustuva Narayan Sharma <kaustuva.ns@sysarris.soft.net>
- Date: Wed, 26 May 2004 14:24:34 +0530
- To: <www-xsl-fo@w3.org>
- Message-ID: <001901c442ff$12acba60$9267a8c0@kaustuva>
Nope :(...now this error is thrown
javax.xml.transform.TransformerException:
org.apache.fop.apps.FOPException: Currently only Table Rows are
supported in table body, header and footer
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:725)
-----Original Message-----
From: christian brugeron [mailto:christian@barzoi.fr]
Sent: Wednesday, May 26, 2004 2:12 PM
To: kaustuva.ns@sysarris.soft.net
Subject: Re: Error in displaying Table Headers.
You have to insert a table-row between your table-header and your cells
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block font-size="12pt" font-weight="bold">Header1</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="12pt" font-weight="bold">Header2</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="12pt" font-weight="bold">Header3</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
Le 26 May 2004, à 10:31, Kaustuva Narayan Sharma a écrit :
Hi,
I am a beginner to FOP. I am trying to convert an XML to PDF. The data
is to be displayed in a table. But when I try to put headers into the
table i am getting the following error:
javax.xml.transform.TransformerException:
org.apache.fop.apps.FOPException: A table cell must be child of
fo:table-row, not fo:table-header
I am referring to "Chapter 18 of the XML Bible, Second Edition : XSL
Formatting Objects" from
http://www.ibiblio.org/xml/books/bible2/chapters/ch18.html#d1e5381.
The xsl file i am using is as follows:
=======================================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no"
indent="yes"/>
<xsl:template match="Report">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4"
page-height="29.7cm" page-width="21cm" margin-top="2cm"
margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="10pt">
<fo:table table-layout="fixed">
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="5cm"/>
<fo:table-body>
<xsl:apply-templates/>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="R">
<fo:table>
<fo:table-header>
<fo:table-cell>
<fo:block font-size="12pt" font-weight="bold">Header1</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="12pt" font-weight="bold">Header2</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="12pt" font-weight="bold">Header3</fo:block>
</fo:table-cell>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="Data1"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="Data2"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="Data3"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
========================================================================
============
I am using fop-0.20.5. Can you please suggest what is the best possible
way? or is the doc i'm referring to is outdated?
Regards,
Kaustuv Sharma
Christian Brugeron
Expert PDF/PostScript - Automatisation de l'édition - XML/XSLT/XSL-FO
Received on Wednesday, 26 May 2004 04:53:29 UTC