Bonjour à tous,
Je suis une débutante dans l'XSLT 1.0 et je suis bloquéedepuis des jours sur quelque chose. Je vous explique donc et vous remercie déjà pour votre aide!
J'aimerais que sur mon pdf, tous les <label_FR> du même <status@valuetext='Confirmé'> soient regroupés l'un à la suite de l'autre sous un même titre Confirmé:
Et ainsi de suite pour les autres valeurs du statut (Infirmé, suspecté) mais dans ce bout d'XML je n'ai l'exemple de de deux statuts Confirmés.
Actuellement, tous les <label_FR> s'affichent mais sans tri et sans regroupement. Comme ceci:
Allergie(s):
Confirmé(s) :
Lait
desc lait
Infirmé(s) :
Fraises
stat inf desc
Confirmé(s) :
Blanc d'oeuf
st conf desssssz
Alors que j'aimerais arriver à:
Allergie(s):
Confirmé(s) :
Lait
desc lait
Blanc d'oeuf
st conf desssssz
Infirmé(s) :
Fraises
stat inf desc
Voici le bout de l'XML :
Voici mon bout de code de l'XSLT:
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 <subreport ver="24" descr="Allergies (fiche santé)" name="SOUS_RAPPORT_ALLERGIES" dateCreation="Mar 06/02" heureCreation="11:51" userCreate="gg"> <ce_atcd_med newline="1" title="1" style="lbl" label="<a style="background:lightgreen">Allergie(s)" unformattedLabel=" Allergie(s):" isModified="0" toPrint="1" indentation="0£2" xmlStyle="B" nextField=""/> <dStart newline="0" title="0" style="date" label="Date de début" unformattedLabel="" isModified="0" toPrint="0" indentation="3" xmlStyle="N£N" nextField="">06/02/2018</dStart> <list style="chk" label="Actif" unformattedLabel="" toPrint="0" indentation="0" xmlStyle="" nextField=""> <active newline="0" style="chk" label="" unformattedLabel="" isModified="0" value="1" toPrint="1" nextField="">on</active> </list> <status newline="0" title="0" style="cmb" label="Statut" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField="" valuetext="Confirmé">VA</status> <dicoLibel newline="0" title="1" style="lbl" label="Libellé" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField=""/> <dico newline="0" title="0" style="dico" label="" unformattedLabel="" isModified="0" toPrint="1" indentation="3" xmlStyle="" nextField=""> <entry entrynum="1"> <code>Al012</code> <label_FR>Lait</label_FR> <label_EN/> <label_NL/> </entry> </dico> <commentLibel newline="0" title="1" style="lbl" label="Description" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField=""/> <text newline="0" title="0" style="txtArea" label="" unformattedLabel="" isModified="0" toPrint="1" indentation="3" xmlStyle="" nextField="">desc lait</text> </subreport> <subreport ver="24" descr="Allergies (fiche santé)" name="SOUS_RAPPORT_ALLERGIES" dateCreation="Mar 06/02" heureCreation="11:51" userCreate="gg"> <ce_atcd_med newline="1" title="1" style="lbl" label="<a style="background:lightgreen">Allergie(s)" unformattedLabel=" Allergie(s):" isModified="0" toPrint="1" indentation="0£2" xmlStyle="B" nextField=""/> <dStart newline="0" title="0" style="date" label="Date de début" unformattedLabel="" isModified="0" toPrint="0" indentation="3" xmlStyle="N£N" nextField="">06/02/2018</dStart> <list style="chk" label="Actif" unformattedLabel="" toPrint="0" indentation="0" xmlStyle="" nextField=""> <active newline="0" style="chk" label="" unformattedLabel="" isModified="0" value="1" toPrint="1" nextField="">on</active> </list> <status newline="0" title="0" style="cmb" label="Statut" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField="" valuetext="Infirmé">I</status> <dicoLibel newline="0" title="1" style="lbl" label="Libellé" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField=""/> <dico newline="0" title="0" style="dico" label="" unformattedLabel="" isModified="0" toPrint="1" indentation="3" xmlStyle="" nextField=""> <entry entrynum="1"> <code>Al052</code> <label_FR>Fraises</label_FR> <label_EN/> <label_NL/> </entry> </dico> <commentLibel newline="0" title="1" style="lbl" label="Description" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField=""/> <text newline="0" title="0" style="txtArea" label="" unformattedLabel="" isModified="0" toPrint="1" indentation="3" xmlStyle="" nextField="">stat inf desc</text> </subreport> <subreport ver="24" descr="Allergies (fiche santé)" name="SOUS_RAPPORT_ALLERGIES" dateCreation="Mar 06/02" heureCreation="11:51" userCreate="gg"> <ce_atcd_med newline="1" title="1" style="lbl" label="<a style="background:lightgreen">Allergie(s)" unformattedLabel=" Allergie(s):" isModified="0" toPrint="1" indentation="0£2" xmlStyle="B" nextField=""/> <dStart newline="0" title="0" style="date" label="Date de début" unformattedLabel="" isModified="0" toPrint="0" indentation="3" xmlStyle="N£N" nextField="">06/02/2018</dStart> <list style="chk" label="Actif" unformattedLabel="" toPrint="0" indentation="0" xmlStyle="" nextField=""> <active newline="0" style="chk" label="" unformattedLabel="" isModified="0" value="1" toPrint="1" nextField="">on</active> </list> <status newline="0" title="0" style="cmb" label="Statut" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField="" valuetext="Confirmé">VA</status> <dicoLibel newline="0" title="1" style="lbl" label="Libellé" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField=""/> <dico newline="0" title="0" style="dico" label="" unformattedLabel="" isModified="0" toPrint="1" indentation="3" xmlStyle="" nextField=""> <entry entrynum="1"> <code>Al052</code> <label_FR>Blanc d'oeuf</label_FR> <label_EN/> <label_NL/> </entry> </dico> <commentLibel newline="0" title="1" style="lbl" label="Description" unformattedLabel="" isModified="0" toPrint="0" indentation="0" xmlStyle="" nextField=""/> <text newline="0" title="0" style="txtArea" label="" unformattedLabel="" isModified="0" toPrint="1" indentation="3" xmlStyle="" nextField="">st conf desssssz</text> </subreport>
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 <xsl:when test="@style='dico'"> <xsl:if test="contains($xmlStyle, 'P')"> <xsl:call-template name="NewPage"/> </xsl:if> <!-- GG: Ajout de la ligne du statut --> <xsl:choose> <xsl:when test="parent::subreport/status/@valuetext='Confirmé'"> <fo:block text-decoration="underline"> <xsl:text> Confirmé(s) : </xsl:text> </fo:block> <fo:block> <xsl:for-each select="entry/label_FR"> <xsl:call-template name="writeelement_withlabel"> <xsl:with-param name="champ_libelle" select="../.."/> <xsl:with-param name="champ_texte" select="."/> <xsl:with-param name="lib_bold" select="'bold'"/> <xsl:with-param name="lib_underline" select="'underline'"/> <xsl:with-param name="marge"> <xsl:value-of select="$marge_def"/> </xsl:with-param> <xsl:with-param name="padding"> <xsl:value-of select="$paddingTop_def"/> </xsl:with-param> <xsl:with-param name="xmlStyle" select="$xmlStyle"/> </xsl:call-template> </xsl:for-each> </fo:block> </xsl:when> <xsl:when test="parent::subreport/status/@valuetext='Suspecté'"> <fo:block text-decoration="underline"> <xsl:text> Suspecté(s) : </xsl:text> </fo:block> <xsl:for-each select="entry/label_FR"> <xsl:call-template name="writeelement_withlabel"> <xsl:with-param name="champ_libelle" select="../.."/> <xsl:with-param name="champ_texte" select="."/> <xsl:with-param name="lib_bold" select="'bold'"/> <xsl:with-param name="lib_underline" select="'underline'"/> <xsl:with-param name="marge"> <xsl:value-of select="$marge_def"/> </xsl:with-param> <xsl:with-param name="padding"> <xsl:value-of select="$paddingTop_def"/> </xsl:with-param> <xsl:with-param name="xmlStyle" select="$xmlStyle"/> </xsl:call-template> </xsl:for-each> </xsl:when> <xsl:when test="parent::subreport/status/@valuetext='Infirmé'"> <fo:block text-decoration="underline"> <xsl:text> Infirmé(s) : </xsl:text> </fo:block> <xsl:for-each select="entry/label_FR"> <xsl:call-template name="writeelement_withlabel"> <xsl:with-param name="champ_libelle" select="../.."/> <xsl:with-param name="champ_texte" select="."/> <xsl:with-param name="lib_bold" select="'bold'"/> <xsl:with-param name="lib_underline" select="'underline'"/> <xsl:with-param name="marge"> <xsl:value-of select="$marge_def"/> </xsl:with-param> <xsl:with-param name="padding"> <xsl:value-of select="$paddingTop_def"/> </xsl:with-param> <xsl:with-param name="xmlStyle" select="$xmlStyle"/> </xsl:call-template> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each select="entry/label_FR"> <xsl:call-template name="writeelement_withlabel"> <xsl:with-param name="champ_libelle" select="../.."/> <xsl:with-param name="champ_texte" select="."/> <xsl:with-param name="lib_bold" select="'bold'"/> <xsl:with-param name="lib_underline" select="'underline'"/> <!--xsl:with-param name="deux-points" select="false()"/--> <xsl:with-param name="marge"> <xsl:value-of select="$marge_def"/> </xsl:with-param> <xsl:with-param name="padding"> <xsl:value-of select="$paddingTop_def"/> </xsl:with-param> <xsl:with-param name="xmlStyle" select="$xmlStyle"/> </xsl:call-template> </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:when>
Partager