-
Notifications
You must be signed in to change notification settings - Fork 0
/
html_apply_templates_2.xsl
56 lines (52 loc) · 1.46 KB
/
html_apply_templates_2.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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cd="http://www.cd.nl" exclude-result-prefixes="cd">
<xsl:output method="html"/>
<xsl:template match="/cd:cdlijst">
<html>
<head>
<title>cdlijst</title>
<style>
body {font-family: arial;}
h2 { color:#003300 }
thead tr { background-color:#003300;
font-size: 16pt;
color: #CCFF00 }
tbody tr {background-color: #CCFF00 }
</style>
</head>
<body>
<h2>CD overzicht:</h2>
<table>
<thead>
<tr>
<th>artiest</th>
<th>titel</th>
<th>speelduur</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates><xsl:sort select="cd:artiest"/></xsl:apply-templates>
</tbody>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="cd:cd">
<tr>
<xsl:apply-templates select="cd:artiest"/>
<xsl:apply-templates select="cd:cdtitel"/>
<xsl:apply-templates select="@speelduur"/>
</tr>
</xsl:template>
<xsl:template match="cd:artiest|cd:cdtitel|@speelduur">
<td>
<xsl:next-match></xsl:next-match>
<xsl:value-of select="."/>
</td>
</xsl:template>
<xsl:template match="cd:*|@*">
<xsl:if test="number(translate(.,':','0'))">
<xsl:attribute name="align">right</xsl:attribute>
</xsl:if>
</xsl:template>
</xsl:stylesheet>