Call-template et parcours
Bonjour, je débute en XSL et XSL-FO et je bloque sur un truc avec un call-template. Ce qui ne va pas est en rouge.
Je voudrais en fait afficher dans le header le nom du questionnaire.
Je cherche aussi la facon de sauter une ligne.
Merci d'avance!
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
| <?xml version="1.0" encoding="ISO-8859-15"?>
<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="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xml.apache.org/fop/extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="all"
page-height="29.7cm"
page-width="21cm"
margin-top="1cm"
margin-bottom="1cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="1cm" margin-bottom="1cm"/>
<fo:region-before extent="3cm"/>
<fo:region-after extent="2.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="all">
<fo:static-content flow-name="xsl-region-before">
<xsl:call-template name="header"/>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<xsl:call-template name="footer"/>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:call-template name="body"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template name="header">
<fo:block text-align="center"
font-size="8pt"
line-height="10pt"
border-bottom="#D1D7DC"
border-bottom-style="solid"
border-bottom-width="1pt"
padding-top="2pt"
padding-right="2pt"
padding-left="2pt"
padding-bottom="2pt">
<xsl:call-template name="questionnaire-header"/>
</fo:block>
</xsl:template>
<xsl:template name="body">
<fo:block>
<xsl:apply-templates select="questionnaire"/>
</fo:block>
<fo:block id="last-page"/>
</xsl:template>
<xsl:template name="questionnaire-header" match="questionnaire">
<fo:block>
<xsl:value-of select="@name" />
</fo:block>
</xsl:template>
<xsl:template match="questionnaire">
<fo:block font-size="24pt" text-align="center" font-weight="bold">
<xsl:value-of select="@name" />
</fo:block>
<fo:block>
<xsl:apply-templates select="theme"/>
</fo:block>
</xsl:template>
<xsl:template match="theme">
<fo:block font-size="18pt">
T<xsl:value-of select="@number" />. <xsl:value-of select="@name" />
</fo:block>
<fo:block>
<xsl:apply-templates select="question"/>
</fo:block>
<fo:block/>
</xsl:template>
<xsl:template match="question">
<fo:block font-size="12pt" text-indent="1em">
Q<xsl:value-of select="@number" />. <xsl:value-of select="@name" />
</fo:block>
<fo:block>
<xsl:apply-templates select="answer"/>
</fo:block>
<fo:block/>
</xsl:template>
<xsl:template match="answer">
<fo:block text-indent="3em">
<xsl:value-of select="@name" />
</fo:block>
</xsl:template>
<xsl:template name="footer">
<fo:block text-align="center"
font-size="8pt"
line-height="10pt"
border-top="#D1D7DC"
border-top-style="solid"
border-top-width="1pt"
padding-top="2pt"
padding-right="2pt"
padding-left="2pt"
padding-bottom="2pt">
<fo:block>
- <fo:page-number/> / <fo:page-number-citation ref-id="last-page"/> -
</fo:block>
</fo:block>
</xsl:template>
</xsl:stylesheet> |