1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" indent="yes" media-type="html" />
<xsl:template match="/">
<fo:table table-layout="fixed"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:table-column column-width="100px"/>
<fo:table-column column-width="100px"/>
<fo:table-body>
<xsl:for-each select="toto/albert">
<xsl:if test="position() mod 2 !=0">
<xsl:text disable-output-escaping="yes">
<![CDATA[<fo:table-row>]]>
</xsl:text>
</xsl:if>
<fo:table-cell>
<xsl:value-of select="node()"/>
</fo:table-cell>
<xsl:if test="(position() mod 2 = 0) or (position() = last())">
<xsl:text disable-output-escaping="yes">
<![CDATA[</fo:table-row>]]>
</xsl:text>
</xsl:if>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet> |