Bonjour,
Depuis mon message d'avant hier, j'ai retravaillé le fichier xls-fo, toutefois je n'arrive toujours pas à obtenir sous une ue tous les modules et évaluation.
Le fichier xml est généré par une application et je cherche
à faire un relevé de notes en pdf. Pour l'instant le premier module et la première évaluation apparaissent.
fichier xml :
fichier xsl-fo
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?xml version="1.0" encoding="iso-8859-1"?> <carnet> <etudiant nom="fleur" prenom="rose" sexe="Mle" /> <note value="14.12"/> <rang ninscrits="9" value="1"/> <note_max value="20"/> <ue code="UE 1.1" titre="economie" numero="2" > <rang ninscrits="15" value="1"/> <note value="13.00"/> <module coef="1.0" code="S10" titre="Initiation" > <note value="13.00"/> <evaluation coef="1.0" description="controle" numero="5"> <note value="14.00"/> </evaluation> </module> <module coef="1.0" code="S20" titre="Intermédiaire" > <note value="11.00"/> <evaluation coef="1.0" description="oral"> <note value="18.00"/> </evaluation> </module> </ue> <ue code="UE 1.2" titre="gestion" numero="6" > <note value="13.00"/> <module coef="1.0" code="G30" titre="Initiation" > <note value="10.00"/> <evaluation coef="1.0" description="dossier"> <note value="11.00"/> </evaluation> </module> <module coef="1.0" code="G50" titre="Intermédiaire" > <note value="13.00"/> <evaluation coef="1.0" description="controle"> <note value="16.00"/> </evaluation> </module> </ue> <ue code="UE 2" titre="anglais" numero="7"> <note value="13.00"/> <module coef="1.0" code="A130" titre="Initiation" > <note value="8.00"/> <evaluation coef="1.0" description="oral"> <note value="9.00"/> </evaluation> </module> </ue> </carnet>
Le code est un peu long et je m'en excuse.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
116
117
118
119
120
121
122
123
124 <?xml version="1.0" encoding="iso-8859-2"?> <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> <fo:layout-master-set> <fo:simple-page-master master-name="exemple" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="2cm" margin-left="1.5cm" margin-right="1.5cm"> <fo:region-body margin-top="3cm" margin-bottom="1.5cm" column-count="3"/> <fo:region-before extent="3cm"/> <fo:region-after extent="1.5cm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="exemple"> <fo:flow flow-name="xsl-region-body"> <fo:block text-indent="0pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt"><xsl:text> Relevé de notes de </xsl:text><xsl:value-of select="carnet/etudiant/@sexe" /> <xsl:text> </xsl:text> <xsl:value-of select="carnet/etudiant/@nom" /> <xsl:text> </xsl:text> <xsl:value-of select="carnet/etudiant/@prenom" /> </fo:block> <fo:table table-layout="fixed" width="100%" border-bottom="1px solid #ccc" font-size=".9em" color="#666"> <fo:table-column column-width="3cm" /> <fo:table-column column-width="6cm" /> <fo:table-column column-width="4cm" /> <fo:table-column column-width="3cm" /> <fo:table-column column-width="2cm" /> <fo:table-header> <fo:table-cell> <fo:block> <xsl:text> Moyenne</xsl:text></fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <!--Récupération de la moyenne de l'étudiant --> <xsl:value-of select="carnet/ue/note/@value" /></fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:text> Rang </xsl:text> <!--Récupération du rang de l'étudiant --> <xsl:value-of select="carnet/ue/rang/@value" /> <xsl:text>/</xsl:text> <!--Récupération du nombre d'inscrits --> <xsl:value-of select="carnet/ue/rang/@ninscrits" /></fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:text> Notes /</xsl:text> <!--Récupération de la note max --> <xsl:value-of select="carnet/ue/note_max/@value" /> </fo:block> </fo:table-cell> </fo:table-header> <fo:table-body> <xsl:apply-templates select="carnet/ue" /> </fo:table-body> </fo:table> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <!--Récupération du code, titre, note du module--> <xsl:template match="carnet/ue"> <fo:table-row > <fo:table-cell background-color="#E0FEFE"> <fo:block ><xsl:value-of select="@code" /></fo:block> </fo:table-cell> <fo:table-cell background-color="#E0FEFE"> <fo:block ><xsl:value-of select="@titre" /></fo:block> </fo:table-cell> <fo:table-cell background-color="#E0FEFE"> <fo:block ><xsl:text> </xsl:text> </fo:block> </fo:table-cell> <fo:table-cell background-color="#E0FEFE"> <fo:block > <xsl:value-of select="note/@value" /> </fo:block></fo:table-cell> <fo:table-cell background-color="#E0FEFE"> <fo:block > <xsl:text> </xsl:text></fo:block> </fo:table-cell> </fo:table-row> <fo:table-row > <fo:table-cell background-color="yellow"> <fo:block ><xsl:value-of select="module/@code" /></fo:block> </fo:table-cell> <fo:table-cell background-color="yellow"> <fo:block ><xsl:value-of select="module/@titre" /> </fo:block> </fo:table-cell> <fo:table-cell background-color="yellow"> <fo:block ><xsl:text> </xsl:text> </fo:block> </fo:table-cell> <fo:table-cell background-color="yellow"> <fo:block > <xsl:value-of select="module/note/@value" /> </fo:block> </fo:table-cell> <fo:table-cell background-color="yellow"> <fo:block > <xsl:value-of select="module/@coef" /> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row > <fo:table-cell> <fo:block> <xsl:text> </xsl:text> </fo:block> </fo:table-cell> <fo:table-cell > <!--Récupération des evaluations des modules avec leur description, note et coef --> <fo:block ><xsl:value-of select="module/evaluation/@description" /> </fo:block></fo:table-cell> <fo:table-cell > <fo:block ><xsl:text> </xsl:text> </fo:block> </fo:table-cell> <fo:table-cell > <fo:block > <xsl:value-of select="module/evaluation/note/@value" /> </fo:block></fo:table-cell> <fo:table-cell > <fo:block > <xsl:value-of select="module/evaluation/@coef" /> </fo:block> </fo:table-cell> </fo:table-row> </xsl:template> </xsl:stylesheet>
Je bloque depuis plusieurs jours: toutes les ue apparaissent mais seul le premier module et la première évaluation apparaissent pour l'ue concernée. J'ai essayé des boucles <xsl:for-each select=""> sans succès. Qui pourrait m'aider à progresser sur ce fichier.
Merci d'avance.
Cordialement,
Partager