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:variable name="type" select="string(.)"/>
\r
26 <xsl:if test="$doc//xreflist[@type=$type]">
\r
27 <xsl:element name="a">
\r
28 <xsl:attribute name="href">#<xsl:value-of select="."/></xsl:attribute>
\r
29 <xsl:value-of select="translate(.,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/><xsl:text>S</xsl:text>
\r
31 <xsl:text> -- </xsl:text>
\r
35 <xsl:for-each select="str:split($types)">
\r
36 <xsl:variable name="type" select="string(.)"/>
\r
37 <xsl:if test="$doc//xreflist[@type=$type]">
\r
38 <xsl:element name="div">
\r
39 <xsl:attribute name="class"><xsl:value-of select="$type"/></xsl:attribute>
\r
40 <xsl:element name="a">
\r
41 <xsl:attribute name="name"><xsl:value-of select="$type"/></xsl:attribute>
\r
42 <h2>Open <xsl:value-of select="translate($type,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>s</h2>
\r
44 <xsl:for-each select="$doc//xreflist[@type=$type]">
\r
45 <xsl:sort select="@module"/>
\r
46 <h3><xsl:value-of select="@module"/> module</h3>
\r
48 <xsl:apply-templates/>
\r
57 <xsl:template match="compound">
\r
59 <xsl:element name="a">
\r
60 <xsl:attribute name="href"><xsl:value-of select="fn:id2url(@id)"/></xsl:attribute>
\r
61 <b><xsl:value-of select="@name"/></b>
\r
65 <xsl:apply-templates/>
\r
69 <xsl:template match="item">
\r
70 <p><xsl:apply-templates/></p>
\r
73 <!-- ====================================================================== -->
\r
74 <!-- Helper functions -->
\r
78 <fn:match>_1_1</fn:match>
\r
79 <fn:replace>_2</fn:replace>
\r
83 <xsl:variable name="nsquote" select="document('')//fn:nsquote/fn:replacement"/>
\r
85 <func:function name="fn:id2url">
\r
86 <xsl:param name="id"/>
\r
87 <!-- Yuck ... I HATE this .. why doesn't xsltproc support XPath 2.0 ... grmpf -->
\r
88 <xsl:variable name="quoted">
\r
89 <xsl:apply-templates select="str:replace($id,$nsquote/fn:match,$nsquote/fn:replace)"/>
\r
91 <xsl:variable name="anchor" select="substring-after($quoted,'_1')"/>
\r
92 <xsl:variable name="file">
\r
93 <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
95 <xsl:variable name="sep" select="substring('#',2-number(boolean($anchor)))"/>
\r
96 <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