-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecipe.xslt
95 lines (95 loc) · 4.36 KB
/
recipe.xslt
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"?>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>Recipes | KRT XML</title>
<link rel="stylesheet" type="text/css" href="recipe.css"/>
</head>
<body>
<header>
Recipe Project - ISTE 610.01 - Knowledge Representation Techniques <br/>
@Author - Nirbhay Pherwani | <a target="_blank" href="https://nirbhay.me">https://nirbhay.me</a>
</header>
<xsl:for-each select="/recipes/recipe">
<div class="card" style="border:5px Solid #C32026; border-radius: 15px;">
<div class="heading">
<b>
<xsl:value-of select="name" />
</b>
</div>
<br />
<div class="heading">
Publisher / Creator : <xsl:value-of select="source" /></div>
<br />
<img style="width:100%">
<xsl:attribute name="src">
<xsl:value-of select="photo" />
</xsl:attribute>
</img>
<p class="serves">
<p class="servings">Serves <xsl:value-of select="serves" /></p>
</p>
<table>
<tr>
<th>Ingredient</th>
<th>Quantity</th>
<th>Measurement</th>
</tr>
<xsl:for-each select="ingredients/ingredient">
<tr>
<td>
<xsl:value-of select="." />
<xsl:choose>
<xsl:when test="@optional='yes'">
<br />
<br />
<div class="optional">
<b>Optional</b>
</div>
</xsl:when>
</xsl:choose>
</td>
<td>
<xsl:value-of select="@amount" />
</td>
<td>
<xsl:value-of select="@measurement" />
</td>
</tr>
</xsl:for-each>
</table>
<br />
<div class="heading">Preparation Steps</div>
<table>
<xsl:for-each select="preparation/step">
<tr>
<td>
<xsl:value-of select="." />
</td>
</tr>
</xsl:for-each>
</table>
<br />
<xsl:choose>
<xsl:when test="hints/hint">
<div class="heading">Hints</div>
<table>
<xsl:for-each select="hints/hint">
<tr>
<td class="hint">
<xsl:value-of select="." />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</div>
<br />
<br />
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>