Bonjours j'ai un fichier XML que je souhaite transformer a l'aide d'un fichier XSLT.
J'ai donc fais ce XSLT :
Le problème c'est que j'ai des erreur car certaine de mes balise ne se ferme pas dans la boucle ou elle a été ouverte.
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 <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/root"> <xsl:result-document href="auNorme.xml"> <!--<?xml version="1.0" encoding="UTF-8"?>--> <root> <xsl:for-each select="eleve"> <!-- Cree variable--> <xsl:variable name="vide" select="''"/> <xsl:variable name="numero" select="num"/> <xsl:variable name="nbre" select="position()"/> <xsl:if test="$vide!=$numero"> <!--Affiche que pour un deuxième passage--> <xsl:if test="$nbre!=1"> </eleve> </xsl:if> <eleve> <num><xsl:value-of select="$numero"/></num> <nom><xsl:value-of select="nom"/></nom> <prenom><xsl:value-of select="prenom"/></prenom> <notes> </xsl:if> <xsl:if test="$vide=$numero"> <notes> </xsl:if> <matiere><xsl:value-of select="matiere"/></matiere> <note><xsl:value-of select="note"/></note> </notes> </xsl:for-each> </eleve> </root> </xsl:result-document> </xsl:template> </xsl:stylesheet>
Comment arranger cela ?
Es-t'-il possible de faire des balises sans les fermer dans leur boucle mais plus bas....???
MERCI
SILVIA
Partager