Improving desktop template
[geeqie.git] / doc / wiki2docbook / html2db / extract-toc.xsl
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
2                 xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"\r
3                 exclude-result-prefixes=""\r
4                 extension-element-prefixes="xalanredirect"\r
5                 xmlns:h="http://www.w3.org/1999/xhtml"\r
6                 version="1.0">\r
7   \r
8   <xsl:output method="html"/>\r
9   \r
10   <xsl:template match="/">\r
11     <xsl:apply-templates select="h:html/h:body/*"/>\r
12   </xsl:template>\r
13   \r
14   <xsl:template match="h:div[@class='toc']">\r
15     <xalanredirect:write file="categories.html">\r
16       <xsl:apply-templates/>\r
17     </xalanredirect:write>\r
18   </xsl:template>\r
19   \r
20   <xsl:template match="h:div[@class='toc']//text()[string(.)='Table of Contents']">\r
21     <xsl:value-of select="/h:html/h:head/h:title/text()"/>\r
22   </xsl:template>\r
23   \r
24   <xsl:template match="@*|node()">\r
25     <xsl:copy>\r
26       <xsl:apply-templates select="@*|node()"/>\r
27     </xsl:copy>\r
28   </xsl:template>\r
29   \r
30   <xsl:template match="h:a[string()='']">\r
31     <xsl:copy>\r
32       <xsl:apply-templates select="@*|node()"/>\r
33       <xsl:text> </xsl:text>\r
34     </xsl:copy>\r
35   </xsl:template>\r
36 </xsl:stylesheet>\r