-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv.preproc.xsl
108 lines (94 loc) · 3.01 KB
/
cv.preproc.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
<?xml version="1.0" encoding="iso-8859-2"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date">
<!-- <xsl:import href="http://www.exslt.org/date/functions/format-date/date.format-date.function.xsl"/> -->
<xsl:output method="xml" encoding="iso-8859-2" omit-xml-declaration="no" indent="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="data">
<xsl:copy-of select="."/>
<datasection>
<sectiontitle><xsl:value-of select="@display"/></sectiontitle>
<xsl:apply-templates/>
</datasection>
</xsl:template>
<xsl:template match="data/name">
<item>
<datahead><xsl:value-of select="@display"/>:</datahead>
<datadesc>
<xsl:if test="title">
<xsl:apply-templates select="title"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates select="lastname"/>,
<xsl:text> </xsl:text>
<xsl:apply-templates select="firstname"/>
</datadesc>
</item>
</xsl:template>
<xsl:template match="data/address">
<item>
<datahead><xsl:value-of select="@display"/>:</datahead>
<datadesc>
<xsl:apply-templates select="street"/><xsl:text>,</xsl:text>
<xsl:apply-templates select="city"/><xsl:text>,</xsl:text>
<xsl:apply-templates select="zip"/><xsl:text> </xsl:text>
<xsl:apply-templates select="country"/>
</datadesc>
</item>
</xsl:template>
<xsl:template match="data/telephone">
<item>
<datahead><xsl:value-of select="@display"/>:</datahead>
<datadesc><xsl:apply-templates/></datadesc>
</item>
</xsl:template>
<xsl:template match="data/email[@smtp]">
<item>
<datahead><xsl:value-of select="@display"/>:</datahead>
<datadesc><a href="mailto:{@smtp}"><xsl:value-of select="@smtp"/></a></datadesc>
</item>
</xsl:template>
<xsl:template match="data/email[not (@smtp)]">
<item>
<datahead><xsl:value-of select="@display"/>:</datahead>
<datadesc><xsl:apply-templates/></datadesc>
</item>
</xsl:template>
<xsl:template match="data/homepage[@uri]">
<item>
<datahead>Home page:</datahead>
<datadesc><a href="{@uri}"><xsl:value-of select="@uri"/></a></datadesc>
</item>
</xsl:template>
<xsl:template match="data/homepage[not (@uri)]">
<item>
<datahead>Home page:</datahead>
<datadesc><xsl:apply-templates/></datadesc>
</item>
</xsl:template>
<!--
<Xsl:template match="data/age">
<item>
<datahead><xsl:value-of select="@display"/>:</datahead>
<datadesc>
<xsl:apply-templates/>
</datadesc>
</item>
</xsl:template>
-->
<xsl:template match="data/birthday">
<item>
<datahead>Date of birth:</datahead>
<datadesc>
<xsl:apply-templates/>
</datadesc>
</item>
</xsl:template>
</xsl:stylesheet>