comparison doc/wiki2docbook/html2db/extract-toc.xsl @ 1773:2ae81598b254

scripts for converting wiki documentation to docbook
author nadvornik
date Sun, 22 Nov 2009 09:12:22 +0000
parents
children
comparison
equal deleted inserted replaced
1772:9f3b7a089caf 1773:2ae81598b254
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"
3 exclude-result-prefixes=""
4 extension-element-prefixes="xalanredirect"
5 xmlns:h="http://www.w3.org/1999/xhtml"
6 version="1.0">
7
8 <xsl:output method="html"/>
9
10 <xsl:template match="/">
11 <xsl:apply-templates select="h:html/h:body/*"/>
12 </xsl:template>
13
14 <xsl:template match="h:div[@class='toc']">
15 <xalanredirect:write file="categories.html">
16 <xsl:apply-templates/>
17 </xalanredirect:write>
18 </xsl:template>
19
20 <xsl:template match="h:div[@class='toc']//text()[string(.)='Table of Contents']">
21 <xsl:value-of select="/h:html/h:head/h:title/text()"/>
22 </xsl:template>
23
24 <xsl:template match="@*|node()">
25 <xsl:copy>
26 <xsl:apply-templates select="@*|node()"/>
27 </xsl:copy>
28 </xsl:template>
29
30 <xsl:template match="h:a[string()='']">
31 <xsl:copy>
32 <xsl:apply-templates select="@*|node()"/>
33 <xsl:text> </xsl:text>
34 </xsl:copy>
35 </xsl:template>
36 </xsl:stylesheet>