-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdcatalog.xsl
82 lines (68 loc) · 1.93 KB
/
cdcatalog.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<style>
body {
background-color: silver;
}
h2{
text-align: center;
color: #1E90FF;
font-family: 'Crimson Text', serif;
}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
border: 2px solid black;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: black;
color: #1E90FF;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
#customers tr:nth-child(even){background-color: #f2f2f2; font-family: 'Crimson Text', serif;;}
#customers tr:nth-child(odd){background-color: #DCDCDC; font-family: 'Crimson Text', serif; }
#customers tr:hover {background-color: #E0FFFF;}
</style>
<link href="https://fonts.googleapis.com/css?family=Crimson+Text|Graduate|Lobster|Quicksand" rel="stylesheet"/>
</head>
<body>
<h2>My CD Collection</h2>
<table id="customers" >
<tr >
<th>Title</th>
<th>Artist</th>
<th>Country</th>
<th>Company</th>
<th>Price</th>
<th>Year</th>
</tr>
<xsl:for-each select="catalog/cd[artist !='Bob Dylan']">
<xsl:sort select="country"/>
<xsl:sort select="artist"/>
<xsl:if test="price < 10">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
<td><xsl:value-of select="country"/></td>
<td><xsl:value-of select="company"/></td>
<td><xsl:value-of select="price"/></td>
<td><xsl:value-of select="year"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>