Une fois mon XSLT rendu, je me retrouve avec des éléments inattendus.

Ces éléments sont les suivants :
<element index="x"/> (x = entier qui semble incrémenté)

Les seules chose dont mon XSLT est sensé afficher sont des éléments P avec un peu de texte à l'intérieur.

Voici mon XSLT où il y a aucun endroit ou je demande d'afficher <element.../>

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
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:output omit-xml-declaration="yes" />
 
	<xsl:template match="/">
 
		<!-- Loop shipments -->	
		<xsl:call-template name="shipmentLoop">
			<xsl:with-param name="shipmentCount"><xsl:value-of select="/root/permit/totalShipments"/></xsl:with-param>
		</xsl:call-template>
 
 
	</xsl:template>
 
	<xsl:template name="shipmentLoop">
		<xsl:param name="shipmentCount"/>
		<xsl:param name="iteration">1</xsl:param>
		<element index="{$iteration}"/>
 
		<xsl:variable name="permitRowCount" select="count(/root/permitRow)" />
		<xsl:variable name="totalPermitRowsToDisplay" select="13"/>
		<!-- <xsl:variable name="totalRows" select="$permitRowCount + ( ( ceiling( ( $permitRowCount - 3 ) / 5 ) ) * 5 ) - ( $permitRowCount - 3 ) "/> -->
 
		<!-- <p>Shipment: <xsl:value-of select="$iteration"/></p> -->
 
		<!-- Loop rows -->
		<xsl:call-template name="permitRowLoop">
			<xsl:with-param name="rowCount"><xsl:value-of select="$totalPermitRowsToDisplay"/></xsl:with-param>
		</xsl:call-template>
 
		<xsl:if test="$iteration &lt; $shipmentCount">
			<xsl:call-template name="shipmentLoop">
				<xsl:with-param name="shipmentCount" select="$shipmentCount"/>
				<xsl:with-param name="iteration" select="$iteration +1"/>
			</xsl:call-template>
		</xsl:if>
 
	</xsl:template>
 
 
	<xsl:template name="permitRowLoop">
		<xsl:param name="rowCount"/>
		<xsl:param name="iteration">1</xsl:param>
		<element index="{$iteration}"/>
 
		<xsl:variable name="actualRowCount" select="count(/root/permitRow)" />
 
		<xsl:variable name="token" select="substring($iteration, string-length($iteration), 1)" />
 
		<!-- if iteration is 1 or last digit of iteration is 4 or 9: Header-->
		<xsl:choose>
			<!-- Tall Header -->
			<xsl:when test="$iteration = 1">
 
				<xsl:call-template name="tallPermitHeader" />
 
			</xsl:when>
			<!-- Short Header -->
			<xsl:when test="$token = 4 or $token = 9">
 
				<xsl:call-template name="shortPermitHeader" />				
 
			</xsl:when>
		</xsl:choose>
 
		<!-- Display of permit rows -->
		<xsl:choose>
			<!-- Row with information -->
			<xsl:when test="$iteration &lt;= $actualRowCount">
 
				<xsl:call-template name="permitRow" />
 
			</xsl:when>
			<!-- Filler row-->
			<xsl:when test="$iteration &gt; $actualRowCount">
 
				<xsl:call-template name="permitRow">
					<xsl:with-param name="emptyYN" select="1"/>
				</xsl:call-template>
 
			</xsl:when>
		</xsl:choose>
 
		<!-- if last digit of iteration is 3 or 8: Footer-->
		<xsl:if test="$token = 3 or $token = 8">
 
			<xsl:call-template name="permitFooter" />
 
		</xsl:if>
 
		<xsl:if test="$iteration &lt; $rowCount">
			<xsl:call-template name="permitRowLoop">
				<xsl:with-param name="rowCount" select="$rowCount"/>
				<xsl:with-param name="iteration" select="$iteration +1"/>
			</xsl:call-template>
		</xsl:if>
 
	</xsl:template>
 
	<xsl:template name="tallPermitHeader">
		<p><strong>Big Header Section</strong></p>
	</xsl:template>
 
	<xsl:template name="shortPermitHeader">
		<p><strong>Small Header Section</strong></p>	
	</xsl:template>
 
	<xsl:template name="permitFooter">
		<p><strong>Footer Section</strong></p>	
	</xsl:template>
 
	<xsl:template name="permitRow">
		<xsl:param name="emptyYN">0</xsl:param>
		<p>Permit Row<xsl:if test="$emptyYN = 1"> empty!</xsl:if></p>
	</xsl:template>
 
</xsl:stylesheet>