-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv.xsl
70 lines (70 loc) · 2.11 KB
/
cv.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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/resume">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="HandheldFriendly" content="true"/>
<link type="text/css" rel="stylesheet" charset="UTF-8" href="xsl.css"/>
</head>
<body>
<div class="page">
<header>
<h1 class="name">
<xsl:value-of select="firstname"/>
<xsl:value-of select="lastname"/>
</h1>
<div class="contact">
<a href="mailto:{email}">
<xsl:value-of select="email"/>
</a>
</div>
</header>
<xsl:for-each select="section">
<section>
<h2>
<xsl:value-of select="title"/>
</h2>
<xsl:if test="highlight">
<div class="experience">
<ul>
<xsl:apply-templates select="highlight"/>
</ul>
</div>
</xsl:if>
<xsl:for-each select="experience">
<div class="experience">
<h3>
<xsl:value-of select="title"/>
</h3>
<div class="dates"><xsl:value-of select="start"/> » <xsl:value-of select="end"/></div>
<div class="location"><xsl:value-of select="organisation"/>, <xsl:value-of select="location"/></div>
<ul>
<xsl:apply-templates select="highlight"/>
</ul>
</div>
</xsl:for-each>
</section>
</xsl:for-each>
<footer>
<xsl:value-of select="document('.git/head-info.xml')/head/hash"/>
</footer>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="highlight">
<li xmlns="http://www.w3.org/1999/xhtml">
<xsl:choose>
<xsl:when test="list">
<xsl:value-of select="text()"/>
<xsl:value-of select="list/item[position() = 1]"/>
<xsl:for-each select="list/item[position() > 1 and position() < last()]" >, <xsl:value-of select="."/></xsl:for-each> &
<xsl:value-of select="list/item[position() = last()]"/>.
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>
</xsl:stylesheet>