-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresume2tex.xsl
executable file
·146 lines (106 loc) · 2.77 KB
/
resume2tex.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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="resume">
<xsl:text>
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage[T2A]{fontenc}
\begin{document}
</xsl:text>
<xsl:apply-templates select="header"/>
<xsl:apply-templates select="history"/>
<xsl:apply-templates select="academics"/>
<xsl:text>
\end{document}
</xsl:text>
</xsl:template>
<!-- BEGIN: Header -->
<xsl:template match="header">
<xsl:apply-templates select="name"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="address"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="name">
<xsl:value-of select="firstname"/>
<xsl:text> </xsl:text>
<xsl:value-of select="surname"/>
</xsl:template>
<xsl:template match="address">
<!-- TODO -->
</xsl:template>
<!-- END: Header -->
<!-- BEGIN: History -->
<xsl:template match="history">
<xsl:apply-templates select="job"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="job">
<xsl:text>Должность: </xsl:text>
<xsl:value-of select="jobtitle"/>
<xsl:text>
</xsl:text>
<xsl:text>Компания: </xsl:text>
<xsl:value-of select="employer"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="period"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="description"/>
</xsl:template>
<xsl:template match="period">
<xsl:apply-templates select="from"/>
<xsl:text> --- </xsl:text>
<xsl:apply-templates select="to"/>
</xsl:template>
<xsl:template match="from">
<xsl:apply-templates select="date"/>
</xsl:template>
<xsl:template match="to">
<xsl:apply-templates select="date"/>
<xsl:apply-templates select="present"/>
</xsl:template>
<xsl:template match="date">
<xsl:value-of select="month"/>
<xsl:text> </xsl:text>
<xsl:value-of select="year"/>
</xsl:template>
<xsl:template match="present">
<xsl:text>сейчас</xsl:text>
</xsl:template>
<xsl:template match="description">
<xsl:apply-templates select="para"/>
</xsl:template>
<xsl:template match="para">
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:template>
<!-- END: History -->
<!-- BEGIN: Academics -->
<xsl:template match="academics">
<xsl:apply-templates select="degrees"/>
</xsl:template>
<xsl:template match="degrees">
<xsl:apply-templates select="degree"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="degree">
<xsl:value-of select="institution"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="period"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="description"/>
</xsl:template>
<!-- END: Academics -->
</xsl:stylesheet>