-
Notifications
You must be signed in to change notification settings - Fork 0
/
cv.xsl
282 lines (270 loc) · 8.28 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns='http://www.w3.org/1999/xhtml' >
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!--
doctype="'-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN'
'http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd'"
media-type="text/html"/>
-->
<xsl:template match="vitae">
<!--
<xsl:text disable-output-escaping="yes">
<!DOCTYPE html
PUBLIC '-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN'
'http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd'/>
</xsl:text>
-->
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta name='viewport' content='width=device-width'/>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<link rel='stylesheet' type='text/css' href='cv.css'/>
<title><xsl:value-of select="profile/shortname"/> -- cirriculum vitae</title>
</head>
<body>
<!--
<xsl:text disable-output-escaping="yes">
</xsl:text>
<xsl:value-of select="boilerplate"/>
<xsl:text disable-output-escaping="yes">
</xsl:text>
-->
<div id="cv">
<h1><xsl:value-of select="profile/fullname"/></h1>
<!--
<div id="profile">
<xsl:apply-templates select="profile/contact"/>
</div>
<xsl:apply-templates select="education/school"/>
-->
<xsl:apply-templates/>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="boilerplate">
</xsl:template>
<xsl:template match="profile">
<div id="profile">
<xsl:apply-templates select="contact[@type='work']"/>
</div>
</xsl:template>
<xsl:template match="//contact[@type='work']">
<div id="address">
<xsl:apply-templates select="department"/>
<xsl:apply-templates select="company"/>
<xsl:value-of select="address/number"/>
<xsl:text> </xsl:text>
<xsl:value-of select="address/street"/><br />
<xsl:value-of select="address/city"/>,
<xsl:value-of select="address/state"/>
<xsl:text> </xsl:text>
<xsl:value-of select="address/code"/>
</div>
<div id="contact">
Mobile: <xsl:value-of select="phone[@type='mobile']"/><br />
<!--Work: <xsl:value-of select="phone[@type='work']"/><br />-->
Email: <a href="mailto:{email}"><xsl:value-of select="email"/></a><br />
</div>
</xsl:template>
<xsl:template match="department|company">
<xsl:value-of select="."/><br />
</xsl:template>
<xsl:template match="education">
<div id="education">
<h2>Education</h2>
<xsl:apply-templates select="school"/>
</div>
</xsl:template>
<xsl:template match="employment">
<div id="{@type}" class="employment">
<h2><xsl:value-of select="@type"/></h2>
<xsl:apply-templates select="job"/>
</div>
</xsl:template>
<xsl:template match="job">
<div class="job">
<h3><xsl:value-of select="company"/></h3>
<xsl:apply-templates select="department|location|position"/>
</div>
</xsl:template>
<xsl:template match="job/department">
<span class="department"><xsl:value-of select="."/></span>
</xsl:template>
<xsl:template match="job/location">
<span class="location"><xsl:value-of select="."/></span>
</xsl:template>
<xsl:template match="job/position">
<div class="job">
<div class="title">
<xsl:value-of select="title"/>
<span class="date">,
<xsl:value-of select="date[@type='start']"/>
<xsl:if test="date[@type='end']">
- <xsl:value-of select="date[@type='end']"/>
</xsl:if>
<xsl:if test="date[@type='present']">
- <span class="date_present">present</span>
</xsl:if>
</span>
</div>
<xsl:if test="description">
<div class="description">
<xsl:value-of select="description"/>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="research">
<div id="research">
<h2>Research</h2>
<xsl:if test="article">
<div>
<h3>Journal Articles</h3>
<xsl:apply-templates select="article"/>
</div>
</xsl:if>
<xsl:if test="proceedings">
<div>
<h3>Conference Proceedings</h3>
<xsl:apply-templates select="proceedings"/>
</div>
</xsl:if>
<xsl:if test="presentation">
<div>
<h3>Presentations</h3>
<xsl:apply-templates select="presentation"/>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="awards">
<div id="awards">
<h2>Awards and Honors</h2>
<ul>
<xsl:for-each select="item">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
<xsl:template match="author">
<xsl:if test="@self">
<span class="self"><xsl:value-of select="."/></span>
</xsl:if>
<xsl:if test="not(@self)">
<span><xsl:value-of select="."/></span>
</xsl:if>
</xsl:template>
<xsl:template match="article|proceedings">
<div class="publication">
<!-- authors -->
<xsl:if test="count(author)=1">
<xsl:apply-templates select="author"/>
</xsl:if>
<xsl:if test="count(author)=2">
<xsl:apply-templates select="author[1]"/>
and
<xsl:apply-templates select="author[2]"/>
</xsl:if>
<xsl:if test="count(author)>2">
<xsl:for-each select="author[position()<last()]">
<xsl:apply-templates select="."/>,
</xsl:for-each>
and
<xsl:apply-templates select="author[last()]"/>
</xsl:if>.
<!-- end authors -->
"<xsl:value-of select="title"/>."
<em><xsl:value-of select="journal"/></em>.
<xsl:if test="volume">
<xsl:value-of select="volume"/>.<xsl:value-of select="issue"/>
</xsl:if>
<xsl:value-of select="' '"/>
<xsl:value-of select="date"/>.
<xsl:if test="pages">
(pp. <xsl:value-of select="pages"/>)
</xsl:if>
</div>
</xsl:template>
<xsl:template match="presentation">
<div class="presentation">
<span class="title"><xsl:value-of select="title"/></span><br />
<span class="event"><xsl:value-of select="event"/></span>,
<span class="location"><xsl:value-of select="location"/></span>,
<span class="date"><xsl:value-of select="date"/></span>.
</div>
</xsl:template>
<xsl:template match="activity[position()=1]">
<div id="activities">
<h2>Activities</h2>
<xsl:for-each select="/vitae/activity">
<div class="activity">
<h3><xsl:value-of select="@type"/></h3>
<table>
<xsl:apply-templates select="item"/>
</table>
</div>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="activity[position()>1]">
</xsl:template>
<xsl:template match="//activity/item">
<tr>
<td class="task"><xsl:value-of select="task"/></td>
<td class="location"><xsl:value-of select="location"/></td>
<td class="date"><xsl:value-of select="date"/></td>
</tr>
</xsl:template>
<xsl:template match="//education/school">
<div class="school">
<span class="degree"><xsl:value-of select="degree"/></span>,
<xsl:value-of select="name"/>,
<xsl:if test="finish[@tbd='1']">
<span class="finish">
<span class="tbd">anticipated <xsl:value-of select="finish"/></span>
</span>
</xsl:if>
<xsl:if test="not(finish[@tbd='1'])">
<span class="finish"><xsl:value-of select="finish"/></span>
</xsl:if>
<xsl:if test="gpa">
<em id="gpa">(GPA: <xsl:value-of select="gpa"/>)</em>
</xsl:if>
<xsl:if test="note | thesis | committee">
<div>
<ul>
<xsl:apply-templates select="note|thesis|committee"/>
<xsl:for-each select="committee">
</xsl:for-each>
</ul>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="note | thesis">
<li>
<xsl:if test="@type">
<em><xsl:value-of select="@type"/>:</em>
</xsl:if>
<xsl:value-of select="."/>
</li>
</xsl:template>
<xsl:template match="committee">
<li>
Committee:
<div id="committee">
<ul>
<xsl:for-each select="member">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
</ul>
</div>
</li>
</xsl:template>
</xsl:stylesheet>