[AdgToyText] Refactored using maps
[adg.git] / docs / gnu / docbook2txt.xsl
blobd896242c8477dbbea59a2899cd9a4b64da292eda
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 % <xsl:value-of select="str:replace(., '&#10;', '&#10; % ')"/>
40 <xsl:text>
41 </xsl:text>
42 </xsl:template>
44 <xsl:template match="itemizedlist|orderedlist">
45 <xsl:apply-templates/>
46 <xsl:text>
47 </xsl:text>
48 </xsl:template>
50 <xsl:template match="itemizedlist[@mark='circle']/listitem[not(@override='disc')]|listitem[@override='circle']">
51 <xsl:call-template name="item">
52 <xsl:with-param name="symbol" select="' o '"/>
53 </xsl:call-template>
54 </xsl:template>
56 <xsl:template match="listitem">
57 <xsl:call-template name="item">
58 <xsl:with-param name="symbol" select="' * '"/>
59 </xsl:call-template>
60 </xsl:template>
62 <xsl:template match="orderedlist/listitem">
63 <xsl:call-template name="item">
64 <xsl:with-param name="symbol"><xsl:number format="1. "/></xsl:with-param>
65 </xsl:call-template>
66 </xsl:template>
68 <xsl:template name="item">
69 <xsl:param name="symbol"/>
70 <xsl:value-of select="$symbol"/><xsl:apply-templates/><xsl:text>
71 </xsl:text>
72 </xsl:template>
74 </xsl:stylesheet>