2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
xmlns="http://www.devhelp.net/book"
5
exclude-result-prefixes="#default">
7
<xsl:template name="generate.devhelp">
8
<xsl:call-template name="write.chunk">
9
<xsl:with-param name="filename">
11
<xsl:when test="$gtkdoc.bookname">
12
<xsl:value-of select="$gtkdoc.bookname"/>
15
<xsl:text>book</xsl:text>
18
<xsl:text>.devhelp</xsl:text>
20
<xsl:with-param name="method" select="'xml'"/>
21
<xsl:with-param name="indent" select="'yes'"/>
22
<xsl:with-param name="encoding" select="'utf-8'"/>
23
<xsl:with-param name="content">
24
<xsl:call-template name="devhelp"/>
29
<xsl:template name="devhelp">
30
<xsl:variable name="title">
31
<xsl:apply-templates select="." mode="generate.devhelp.toc.title.mode"/>
33
<xsl:variable name="link">
34
<xsl:call-template name="href.target"/>
36
<xsl:variable name="author">
37
<xsl:if test="articleinfo|bookinfo">
38
<xsl:apply-templates mode="generate.devhelp.authors"
39
select="articleinfo|bookinfo"/>
42
<xsl:variable name="toc.nodes" select="part|reference|preface|chapter|
43
appendix|article|bibliography|
44
glossary|index|refentry|
47
<book title="{$title}" link="{$link}" author="{$author}" name="{$gtkdoc.bookname}">
48
<xsl:if test="$toc.nodes">
50
<xsl:apply-templates select="$toc.nodes"
51
mode="generate.devhelp.toc.mode"/>
55
<xsl:apply-templates select="//refsect1"
56
mode="generate.devhelp.constructor.index.mode"/>
57
<xsl:apply-templates select="//refsect2"
58
mode="generate.devhelp.index.mode"/>
63
<xsl:template match="*" mode="generate.devhelp.toc.mode">
64
<xsl:variable name="title">
65
<xsl:apply-templates select="." mode="generate.devhelp.toc.title.mode"/>
67
<xsl:variable name="target">
68
<xsl:variable name="anchor" select="title/anchor"/>
70
<xsl:when test="$anchor">
71
<xsl:call-template name="href.target">
72
<xsl:with-param name="object" select="$anchor"/>
76
<xsl:call-template name="href.target"/>
81
<sub name="{$title}" link="{$target}">
82
<xsl:apply-templates select="section|sect1|
84
bridgehead|part|chapter"
85
mode="generate.devhelp.toc.mode"/>
89
<xsl:template match="*" mode="generate.devhelp.index.mode">
90
<xsl:variable name="title" select="title"/>
91
<xsl:variable name="anchor" select="title/anchor"/>
92
<xsl:variable name="target">
94
<xsl:when test="$anchor">
95
<xsl:call-template name="href.target">
96
<xsl:with-param name="object" select="$anchor"/>
100
<xsl:call-template name="href.target"/>
104
<function name="{$title}" link="{$target}"/>
107
<xsl:template match="*" mode="generate.devhelp.constructor.index.mode">
108
<xsl:variable name="title" select="title"/>
109
<xsl:variable name="anchor" select="title/anchor"/>
110
<xsl:variable name="target">
112
<xsl:when test="$anchor">
113
<xsl:call-template name="href.target">
114
<xsl:with-param name="object" select="$anchor"/>
118
<xsl:call-template name="href.target"/>
122
<xsl:if test="$title='Constructor'">
123
<xsl:variable name ="constructor" select="programlisting//methodname"/>
124
<function name="{$constructor}" link="{$target}"/>
129
<xsl:template match="article" mode="generate.devhelp.toc.title.mode">
130
<xsl:value-of select="articleinfo/title"/>
132
<xsl:template match="book" mode="generate.devhelp.toc.title.mode">
133
<xsl:value-of select="bookinfo/title"/>
135
<xsl:template match="refentry" mode="generate.devhelp.toc.title.mode">
136
<xsl:value-of select="refnamediv/refname"/>
138
<xsl:template match="*" mode="generate.devhelp.toc.title.mode">
139
<xsl:value-of select="title"/>
142
<!-- generate list of authors ... -->
143
<xsl:template match="articleinfo|bookinfo" mode="generate.devhelp.authors">
144
<xsl:for-each select="authorgroup/author">
145
<xsl:value-of select="firstname"/>
146
<xsl:text> </xsl:text>
147
<xsl:value-of select="surname"/>
148
<xsl:if test="not(last())">
149
<xsl:text>, </xsl:text>