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/>
13 <xsl:template match=
"div[@class='section']/h1">
14 <xsl:value-of select=
"normalize-space(.)"/>
15 <xsl:text>
</xsl:text>
18 <xsl:template match=
"div[@class='subsection']/h2">
19 <xsl:text> </xsl:text>
20 <xsl:value-of select=
"normalize-space(.)"/>
21 <xsl:text>
</xsl:text>
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>
</xsl:text>
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>
</xsl:text>