1 <?xml version='
1.0'
?> <!--*- mode: xml -*-->
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=
"$gtkdoc.refsect2"
56 mode=
"generate.devhelp.index.mode"/>
61 <xsl:template match=
"*" mode=
"generate.devhelp.toc.mode">
62 <xsl:variable name=
"title">
63 <xsl:apply-templates select=
"." mode=
"generate.devhelp.toc.title.mode"/>
65 <xsl:variable name=
"target">
66 <xsl:variable name=
"anchor" select=
"title/anchor"/>
68 <xsl:when test=
"$anchor">
69 <xsl:call-template name=
"href.target">
70 <xsl:with-param name=
"object" select=
"$anchor"/>
74 <xsl:call-template name=
"href.target"/>
79 <sub name=
"{$title}" link=
"{$target}">
80 <xsl:apply-templates select=
"section|sect1|
82 bridgehead|part|chapter|glossary|index"
83 mode=
"generate.devhelp.toc.mode"/>
87 <xsl:template match=
"*" mode=
"generate.devhelp.index.mode">
88 <xsl:variable name=
"title" select=
"title"/>
89 <xsl:variable name=
"anchor" select=
"title/anchor"/>
90 <xsl:variable name=
"target">
92 <xsl:when test=
"$anchor">
93 <xsl:call-template name=
"href.target">
94 <xsl:with-param name=
"object" select=
"$anchor"/>
98 <xsl:call-template name=
"href.target"/>
102 <function name=
"{$title}" link=
"{$target}"/>
106 <xsl:template match=
"article" mode=
"generate.devhelp.toc.title.mode">
107 <xsl:value-of select=
"articleinfo/title"/>
109 <xsl:template match=
"book" mode=
"generate.devhelp.toc.title.mode">
110 <xsl:value-of select=
"bookinfo/title"/>
112 <xsl:template match=
"refentry" mode=
"generate.devhelp.toc.title.mode">
113 <xsl:value-of select=
"refmeta/refentrytitle"/>
115 <xsl:template match=
"*" mode=
"generate.devhelp.toc.title.mode">
116 <xsl:value-of select=
"title"/>
119 <!-- generate list of authors ... -->
120 <xsl:template match=
"articleinfo|bookinfo" mode=
"generate.devhelp.authors">
121 <xsl:for-each select=
"authorgroup/author">
122 <xsl:value-of select=
"firstname"/>
123 <xsl:text> </xsl:text>
124 <xsl:value-of select=
"surname"/>
125 <xsl:if test=
"not(last())">
126 <xsl:text>,
</xsl:text>