Hello.
I'm writing this email due to a problem I'm having with the RTF renderer
in FOP 0.93.
I'm using this xslt stylesheet to create a XML-FO document which I then
run into FOP to get a RTF file:
=== BEGIN ===
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output encoding="ISO-8859-1" method="xml"/>
<xsl:template match="allPla">
<xsl:for-each select="pla">
<xsl:if test="position() mod 2 = 0">
<fo:table-row background-color="#f0f0f0">
<fo:table-cell column-number="1"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="dataInizio"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="2"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="dataScadenza"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="3"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="durataGiorni"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="4"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="giorniUtilizzo"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="5"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="smsInviati"/></fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
<xsl:if test="position() mod 2 = 1">
<fo:table-row>
<fo:table-cell column-number="1"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="dataInizio"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="2"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="dataScadenza"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="3"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="durataGiorni"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="4"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="giorniUtilizzo"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="5"
display-align="center" text-align="center">
<fo:block><fo:inline font-family="Arial,
sans-serif" font-size="9.0pt" font-weight="normal"><xsl:value-of
select="smsInviati"/></fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="pm0"
page-height="29.7cm" page-width="21cm" margin-bottom="1cm"
margin-left="1.5cm" margin-right="1.5cm" margin-top="1cm">
<fo:region-body/>
<fo:region-before extent="0.5cm"/>
<fo:region-after extent="0.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="pm0"
force-page-count="no-force" initial-page-number="1">
<fo:flow flow-name="xsl-region-body">
<fo:table text-align="center" table-layout="fixed"
border-bottom-style="solid" border-left-style="solid"
border-right-style="solid">
<fo:table-column column-number="1" column-width="4cm"/>
<fo:table-column column-number="2" column-width="4cm"/>
<fo:table-column column-number="3" column-width="3cm"/>
<fo:table-column column-number="4" column-width="4cm"/>
<fo:table-column column-number="5" column-width="2cm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell column-number="1"
display-align="center" text-align="center">
<fo:block border-top-style="solid"
border-bottom-style="solid"><fo:inline font-family="Arial, sans-serif"
font-size="9.0pt" font-weight="bold">Data di
attivazione</fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="2"
display-align="center" text-align="center">
<fo:block border-top-style="solid"
border-bottom-style="solid"><fo:inline font-family="Arial, sans-serif"
font-size="9.0pt" font-weight="bold">Data di
disattivazione</fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="3"
display-align="center" text-align="center">
<fo:block border-top-style="solid"
border-bottom-style="solid"><fo:inline font-family="Arial, sans-serif"
font-size="9.0pt" font-weight="bold">Giornate</fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="4"
display-align="center" text-align="center">
<fo:block border-top-style="solid"
border-bottom-style="solid"><fo:inline font-family="Arial, sans-serif"
font-size="9.0pt" font-weight="bold">Giornate di
utilizzo</fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell column-number="5"
display-align="center" text-align="center">
<fo:block border-top-style="solid"
border-bottom-style="solid"><fo:inline font-family="Arial, sans-serif"
font-size="9.0pt" font-weight="bold">SMS inviati</fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:apply-templates select="report/bersaglio/allPla"/>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
=== END ===
The xml input file is like:
=== BEGIN ===
<report>
<bersaglio>
<allPla>
<pla id="81">
<bersaglio>2</bersaglio>
<dataInizio>2007-06-25 00:00:00</dataInizio>
<dataScadenza>2007-06-29 18:05:44</dataScadenza>
<durataGiorni>5</durataGiorni>
<giorniUtilizzo>0</giorniUtilizzo>
<smsInviati>0</smsInviati>
</pla>
<pla id="41">
<bersaglio>2</bersaglio>
<dataInizio>2007-06-27 15:27:43</dataInizio>
<dataScadenza>2007-06-27 15:49:14</dataScadenza>
<durataGiorni>1</durataGiorni>
<giorniUtilizzo>0</giorniUtilizzo>
<smsInviati>0</smsInviati>
</pla>
<pla id="44">
<bersaglio>2</bersaglio>
<dataInizio>2007-06-27 16:16:14</dataInizio>
<dataScadenza>2007-06-27 16:16:25</dataScadenza>
<durataGiorni>1</durataGiorni>
<giorniUtilizzo>0</giorniUtilizzo>
<smsInviati>0</smsInviati>
</pla>
<pla id="45">
<bersaglio>2</bersaglio>
<dataInizio>2007-06-27 16:16:53</dataInizio>
<dataScadenza>2007-06-27 16:41:12</dataScadenza>
<durataGiorni>1</durataGiorni>
<giorniUtilizzo>0</giorniUtilizzo>
<smsInviati>0</smsInviati>
</pla>
</allPla>
</bersaglio>
</report>
=== END ===
This should result in a table with alternating background color, with a
header and 4 rows each made of 5 columns.
Everything is working fine if I use the PDF renderer (I get the table
with 4 rows of 5 columns).
If I use the RTF renderer the 5 columns are collapsed into one column,
with the text of the 5 cells joined and put in the single cell of the
resulting 1-column row. The joined column is 4 cm large (just like
the first column of the correct table).
Does anyone know what's happening? Are tables supported in the RTF
renderer? Or is there a way to make it work correctly? (Missing tags,
etc...)
Many thanks in advance to anyone who can help me.
Gabriele
--
Gabriele Del Prete
Ricerca e Sviluppo Progetti
Radiotrevisan Elettronica Industriale S.p.A.
Tel. : +39 040 3883 857
E-Mail: [EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]