1 <?xml version="1.0" encoding="utf-8"?>
\r
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
\r
4 xmlns:fn="http://senf.berlios.de/xml/Extensions"
\r
5 xmlns:exsl="http://exslt.org/common"
\r
6 xmlns:str="http://exslt.org/strings"
\r
7 xmlns:func="http://exslt.org/functions"
\r
8 extension-element-prefixes="str fn exsl func"
\r
11 <xsl:include href="functions.xsl"/>
\r
13 <xsl:output method="html"/>
\r
14 <xsl:strip-space elements="*"/>
\r
15 <xsl:param name="title" select="''"/>
\r
16 <xsl:param name="types" select="'bug todo'"/>
\r
18 <xsl:template match="/">
\r
20 <h1><xsl:value-of select="$title"/></h1>
\r
21 <xsl:variable name="doc" select="."/>
\r
23 <xsl:text> -- </xsl:text>
\r
24 <xsl:for-each select="str:split($types)">
\r
25 <xsl:element name="a">
\r
26 <xsl:attribute name="href">#<xsl:value-of select="."/></xsl:attribute>
\r
27 <xsl:value-of select="translate(.,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/><xsl:text>S</xsl:text>
\r
29 <xsl:text> -- </xsl:text>
\r
32 <xsl:for-each select="str:split($types)">
\r
33 <xsl:variable name="type" select="string(.)"/>
\r
34 <xsl:element name="div">
\r
35 <xsl:attribute name="class"><xsl:value-of select="$type"/></xsl:attribute>
\r
36 <xsl:element name="a">
\r
37 <xsl:attribute name="name"><xsl:value-of select="$type"/></xsl:attribute>
\r
38 <h2>Open <xsl:value-of select="translate($type,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>s</h2>
\r
40 <xsl:for-each select="$doc//xreflist[@type=$type]">
\r
41 <xsl:sort select="@module"/>
\r
42 <h3><xsl:value-of select="@module"/> module</h3>
\r
44 <xsl:apply-templates/>
\r
52 <xsl:template match="compound">
\r
54 <xsl:element name="a">
\r
55 <xsl:attribute name="href"><xsl:value-of select="fn:id2url(@id)"/></xsl:attribute>
\r
56 <b><xsl:value-of select="@name"/></b>
\r
60 <xsl:apply-templates/>
\r
64 <xsl:template match="item">
\r
65 <p><xsl:apply-templates/></p>
\r
68 <!-- ====================================================================== -->
\r
69 <!-- Helper functions -->
\r
73 <fn:match>_1_1</fn:match>
\r
74 <fn:replace>_2</fn:replace>
\r
78 <xsl:variable name="nsquote" select="document('')//fn:nsquote/fn:replacement"/>
\r
80 <func:function name="fn:id2url">
\r
81 <xsl:param name="id"/>
\r
82 <!-- Yuck ... I HATE this .. why doesn't xsltproc support XPath 2.0 ... grmpf -->
\r
83 <xsl:variable name="quoted">
\r
84 <xsl:apply-templates select="str:replace($id,$nsquote/fn:match,$nsquote/fn:replace)"/>
\r
86 <xsl:variable name="anchor" select="substring-after($quoted,'_1')"/>
\r
87 <xsl:variable name="file">
\r
88 <xsl:apply-templates select="str:replace(substring($quoted,1,string-length($quoted) - number(boolean($anchor))*2 - string-length($anchor)),$nsquote/fn:replace,$nsquote/fn:match)"/>
\r
90 <xsl:variable name="sep" select="substring('#',2-number(boolean($anchor)))"/>
\r
91 <func:result>../../<xsl:value-of select="ancestor::xreflist/@module"/>/doc/html/<xsl:value-of select="$file"/>.html<xsl:value-of select="$sep"/><xsl:value-of select="$anchor"/></func:result>
\r