Change manual page markup, making it more parsable
[pipeglade.git] / www-template / outline.xsl
blob0e244c5af733615c6fd0691047f40463f6245d07
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4 <!-- Extract the hierarchy of section headings from html -->
5 <xsl:output method="text"/>
7 <xsl:template match="script|noscript"/>
9 <xsl:template match="@*|node()">
10 <xsl:apply-templates/>
11 </xsl:template>
13 <xsl:template match="div[@class='section']/h1">
14 <xsl:value-of select="normalize-space(.)"/>
15 <xsl:text>&#xA;</xsl:text>
16 </xsl:template>
18 <xsl:template match="div[@class='subsection']/h2">
19 <xsl:text> </xsl:text>
20 <xsl:value-of select="normalize-space(.)"/>
21 <xsl:text>&#xA;</xsl:text>
22 </xsl:template>
24 <xsl:template match="div[@class='subsection']/dl/dt/text()">
25 <xsl:text> </xsl:text>
26 <xsl:value-of select="normalize-space(.)"/>
27 <xsl:text>&#xA;</xsl:text>
28 </xsl:template>
30 <xsl:template
31 match="div[@class='subsection']/dl/dd/ul/li/b[@class='flag']">
32 <xsl:variable name="action" select="normalize-space(.)"/>
33 <xsl:if test="starts-with($action, ':')">
34 <xsl:if test="string-length($action)>2">
35 <xsl:text> </xsl:text>
36 <xsl:value-of select="$action"/>
37 <xsl:text>&#xA;</xsl:text>
38 </xsl:if>
39 </xsl:if>
40 </xsl:template>
42 </xsl:stylesheet>