-
Notifications
You must be signed in to change notification settings - Fork 0
/
books.xsl
70 lines (68 loc) · 3.11 KB
/
books.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/catalog">
<html>
<head>
<link href="books.css" rel="stylesheet" type="text/css"></link>
</head>
<body>
<div class="navbar">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
</div>
<div class="main">
<div class ="title">
<h1>Book Catalog</h1>
</div>
<div class="intro">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pretium dolor eget pulvinar aliquam. Phasellus at euismod ligula. Cras viverra semper laoreet. Nulla ac diam suscipit, aliquet metus nec, maximus dolor. Sed accumsan arcu ut nisi mattis porttitor. Fusce mattis vestibulum fermentum. Praesent sed eros rhoncus, varius magna eget, malesuada ex. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ipsum enim, ut egestas ligula ornare eget. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut volutpat placerat arcu non iaculis. Donec eget libero dignissim, interdum metus non, scelerisque ipsum. Etiam pretium rutrum sagittis. Proin rhoncus mi quis justo pharetra pretium.</p>
</div>
<table class="mainTable">
<tr>
<th><b>Title</b></th>
<th><b>Genre</b></th>
<th><b>Date Published</b></th>
<th><b>Rating</b></th>
</tr>
<xsl:for-each select="book">
<tr>
<td>
<table>
<tr><b><xsl:value-of select="title" /></b></tr>
<tr><i><xsl:value-of select="author" /></i></tr>
</table>
</td>
<td><xsl:value-of select="genre" /></td>
<td><xsl:value-of select="publish_date" /></td>
<td>
<xsl:choose>
<xsl:when test="rating = 0">
Poor
</xsl:when>
<xsl:when test="rating = 1">
Average
</xsl:when>
<xsl:when test="rating = 2">
Good
</xsl:when>
<xsl:when test="rating = 3">
Excellent
</xsl:when>
<xsl:otherwise>
N/A
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
<div class="intro">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pretium dolor eget pulvinar aliquam. Phasellus at euismod ligula. Cras viverra semper laoreet. Nulla ac diam suscipit, aliquet metus nec, maximus dolor. Sed accumsan arcu ut nisi mattis porttitor. Fusce mattis vestibulum fermentum. Praesent sed eros rhoncus, varius magna eget, malesuada ex. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ipsum enim, ut egestas ligula ornare eget. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut volutpat placerat arcu non iaculis. Donec eget libero dignissim, interdum metus non, scelerisque ipsum. Etiam pretium rutrum sagittis. Proin rhoncus mi quis justo pharetra pretium.</p>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>