problème entre fo:table et fo:root
Bonjour,
J'ai un petit soucis sur un fichier xsl qui doit me créer un pdf grace à xsl:fo.
Quand je lance la création du pdf avec ce code, le terminal me dit :
First element must be the fo:root
Et quand j'imbrique mon fo:table dans un fo:root, il me dit :
{http://www.w3.org/1999/XSL/Format}table" is not a valid child of "fo:root"!
Code:
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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="gallerie">
<fo:table>
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body>
<fo:table-row>
<xsl:for-each select="tableau">
<fo:table-cell>
<fo:block>
<xsl:variable name="urlImage" select="@image"/>
<fo:external-graphic src="url({$urlImage})" content-width="100%" padding-left="2pt"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="titre/text()"/>
<xsl:value-of select="dimension/text()"/>
<xsl:value-of select="technique/text()"/>
<xsl:value-of select="lieuExposition/text()"/>
</fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet> |
Quelle pourrait-être la solution à cela ?
merci