-
Notifications
You must be signed in to change notification settings - Fork 0
/
org.xsl
44 lines (36 loc) · 1.38 KB
/
org.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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="db xlink"
version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" encoding="utf-8" />
<xsl:strip-space elements="db:article db:section" />
<xsl:template match="/db:article/db:title" />
<xsl:template match="/db:article/db:info" />
<xsl:template match="//db:section/db:title">
<xsl:text>
</xsl:text>
<h2><xsl:value-of select="." /></h2>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="//db:spoiler/text()">
<xsl:value-of select="normalize-space(.)" />
</xsl:template>
<xsl:template match="db:link">
<a href="{@xlink:href}"><xsl:value-of select="." /></a>
</xsl:template>
<xsl:template match="db:spoiler">
<xsl:element name="{name()}">
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="db:cut">
<habracut />
</xsl:template>
<xsl:template match="db:programlisting">
<source lang="lisp">
<xsl:value-of select="." />
</source>
</xsl:template>
</xsl:stylesheet>