-
Notifications
You must be signed in to change notification settings - Fork 0
/
html_tex.xml
71 lines (49 loc) · 1.36 KB
/
html_tex.xml
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
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xhtml xsl xs" >
<xsl:output method="text" version="1.0" encoding="UTF-8" />
<!-- MAIN TEMPLATE -->
<xsl:template match="/html">
<xsl:for-each select="//div[@id='content']">
<xsl:apply-templates />
</xsl:for-each>
</xsl:template>
<!-- h1 (section) -->
<xsl:template match="h1">
\section{<xsl:value-of select="." />}
</xsl:template>
<!-- h2 (subsection) -->
<xsl:template match="h2">
\subsection{<xsl:value-of select="." />}
</xsl:template>
<!-- unordered list -->
<xsl:template match="ul">
\begin{itemize}
<xsl:apply-templates />
\end{itemize}
</xsl:template>
<!-- ordered list -->
<xsl:template match="ol">
\begin{enumerate}
<xsl:apply-templates />
\end{enumerate}
</xsl:template>
<!-- definition list -->
<xsl:template match="dl">
\begin{description}
<xsl:apply-templates />
\end{description}
</xsl:template>
<!-- list item -->
<xsl:template match="li">
\item <xsl:apply-templates />
</xsl:template>
<!-- italics -->
<xsl:template match="em">\emph{<xsl:apply-templates />}</xsl:template>
<!-- bold -->
<xsl:template match="strong">\textbf{<xsl:apply-templates />}</xsl:template>
</xsl:stylesheet>