Bonjour,
Je souhaiterai avoir une variable qui prend une valeur donnée dans le XML.
Jusqu'à là pas de pb...
Ensuite, je voudrais que cette variable soit utilisée dans mon XSL dans une propriété...
Je voudrais que mon texte1 se trouve sur 3 colonnes...
Voici mon XML :
Dans mon XSL :
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 <Ligne1> <Cellule1> <Texte1>1.58.05.01.053</Texte1> </Cellule1> <Cellule1 > <Texte1>M.</Texte1> </Cellule1> <Cellule1 var="3" > <Texte1>Busch</Texte1> </Cellule1> <Cellule1> <Texte1>Armand </Texte1> </Cellule1> </Ligne1>
Mon pb principal est que mon tableau soit dynamique et je voudrais optimiser la saisie du XML pour ne pas kon doive compter a chaque fois le nombre de colone :
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 <xsl:template match="Cellule1"> <xsl:if test="count(ancestor::Ligne1/Cellule1) = 1"> <fo:table-cell text-align="center" number-columns-spanned="{$var}" border-left-color="black" border-left-style="solid" border-left-width="0.5pt" > <fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt" > <xsl:value-of select="Texte1"/> </fo:block> </fo:table-cell> </xsl:if> <xsl:if test="count(ancestor::Ligne1/Cellule1) > 1 and position()!=last()"> <fo:table-cell text-align="center" number-columns-spanned="{$var}" border-left-color="black" border-left-style="solid" border-left-width="0.5pt"> <fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt" > <xsl:value-of select="Texte1"/> </fo:block> </fo:table-cell> </xsl:if> <xsl:if test="count(ancestor::Ligne1/Cellule1) > 1 and position()=last()"> <fo:table-cell text-align="center" number-columns-spanned="{$var}" border-left-color="black" border-left-style="solid" border-left-width="0.5pt" border-right-color="black" border-right-width="0.5pt" border-right-style="solid"> <fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt" > <xsl:value-of select="Texte1"/> </fo:block> </fo:table-cell> </xsl:if> </xsl:template>
Ex:
A- Age-------------------------B- Nom
C- Prenom----D- Adresse-------E- LKFJ
Donc voila j'aimerai que dans mon XML lorsque l'on veut saisr la première ligne on rentre :
et grâce à var=2 on fusionnera 2 cellules...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <ligne> <cellule var="2"> <texte>45 ans</texte> </cellule> <cellule> <texte> Nom de famille </texte> </cellule> </ligne>
J'espère avoir été un minimum compréhensible...![]()
Merci d'avance !!!
Partager