doc: refactored to be more mainstream
[adg.git] / docs / docbook2txt.xsl
blobbc165440127207c8ef14dde198a849908f4ee08d
1 <?xml version="1.0" encoding="utf-8"?>
3 <xsl:stylesheet version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:str="http://exslt.org/strings">
7 <xsl:output method="text" omit-xml-declaration="yes" indent="no" encoding="utf-8"/>
8 <xsl:strip-space elements="*"/>
10 <xsl:template match="/chapter/title|subtitle">
11 </xsl:template>
13 <xsl:template match="simplesect">
14 <xsl:apply-templates/>
15 <xsl:text>
16 </xsl:text>
17 </xsl:template>
19 <xsl:template match="title">
20 <xsl:value-of select="."/>
21 <xsl:text>
22 </xsl:text>
23 <xsl:value-of select="str:padding(string-length(),'=')"/>
24 <xsl:text>
26 </xsl:text>
27 </xsl:template>
29 <xsl:template match="para">
30 <xsl:apply-templates/>
31 <xsl:text>
33 </xsl:text>
34 </xsl:template>
36 <xsl:template match="ulink"><xsl:value-of select="."/> (<xsl:value-of select="@url"/>)</xsl:template>
38 <xsl:template match="programlisting">
39 ------------------------------------------------------------------
40 <xsl:value-of select="."/>
41 ------------------------------------------------------------------
42 <xsl:text>
43 </xsl:text>
44 </xsl:template>
46 <xsl:template match="itemizedlist|orderedlist">
47 <xsl:apply-templates/>
48 <xsl:text>
49 </xsl:text>
50 </xsl:template>
52 <xsl:template match="itemizedlist[@mark='circle']/listitem[not(@override='disc')]|listitem[@override='circle']">
53 <xsl:call-template name="item">
54 <xsl:with-param name="symbol" select="' o '"/>
55 </xsl:call-template>
56 </xsl:template>
58 <xsl:template match="listitem">
59 <xsl:call-template name="item">
60 <xsl:with-param name="symbol" select="' * '"/>
61 </xsl:call-template>
62 </xsl:template>
64 <xsl:template match="orderedlist/listitem">
65 <xsl:call-template name="item">
66 <xsl:with-param name="symbol"><xsl:number format="1. "/></xsl:with-param>
67 </xsl:call-template>
68 </xsl:template>
70 <xsl:template name="item">
71 <xsl:param name="symbol"/>
72 <xsl:value-of select="$symbol"/><xsl:apply-templates/><xsl:text>
73 </xsl:text>
74 </xsl:template>
76 </xsl:stylesheet>