-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVoiture.xsl
95 lines (86 loc) · 4.78 KB
/
Voiture.xsl
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" doctype-public="XHTML"/>
<xsl:template match="/">
<html>
<head>
<title>XSL</title>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"/>
</head>
<body>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Photo</th>
<th scope="col">annee</th>
<th scope="col">marque</th>
<th scope="col">modele</th>
<th scope="col">km</th>
<th scope="col">color</th>
<th scope="col">prix</th>
<th scope="col">ServiceCarOccas</th>
<th scope="col">SelectioncarOccas</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="voitures/voiture">
<xsl:sort select="kilometrage" data-type="number"/>
<tr>
<xsl:if test="(kilometrage <20000)and (caroccas/@garantie='oui')">
<xsl:attribute name="style">
font-weight: bold;
</xsl:attribute>
</xsl:if>
<td>
<xsl:element name="image">
<xsl:attribute name="src"><xsl:value-of select="photo"/></xsl:attribute>
</xsl:element>
</td>
<td>
<xsl:value-of select="@annee"/>
</td>
<td>
<xsl:value-of select="@marque"/>
</td>
<td>
<xsl:value-of select="@modele"/>
</td>
<td>
<xsl:value-of select="kilometrage"/>
</td>
<td>
<xsl:attribute name="bgcolor">
<xsl:value-of select="couleur"/></xsl:attribute>
</td>
<td>
<xsl:value-of select="prix"/>€
</td>
<td>
<xsl:choose>
<xsl:when test="(caroccas/@garantie='oui')and(caroccas/@reprise='non')">Garantie</xsl:when>
<xsl:when test="(caroccas/@garantie='non')and(caroccas/@reprise='oui')">Reprise</xsl:when>
<xsl:when test="(caroccas/@garantie='oui')and(caroccas/@reprise='oui')">Garantie+Reprise</xsl:when>
<xsl:otherwise> Aucun </xsl:otherwise>
</xsl:choose>
<xsl:value-of select="caroccas"/>
</td>
<td>
<xsl:if test="(caroccas/@garantie='oui')">
<img src="start-icon.jpg" width="20px"></img>
</xsl:if>
<xsl:if test="(caroccas/@reprise='oui')">
<img src="start-icon.jpg" width="20px"></img>
</xsl:if>
<xsl:if test="(kilometrage <20000)">
<img src="start-icon.jpg" width="20px"></img>
</xsl:if>
<xsl:value-of select="SelectioncarOccas"/>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>