1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by xsl2profile-->
3 <!--from the DocBook XSL stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exsl="http://exslt.org/common" xmlns:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" version="1.0" exclude-result-prefixes="exsl db ng exslt">
6 <xsl:import href="../html/chunk.xsl"/>
8 <!-- ********************************************************************
9 $Id: eclipse.xsl 8400 2009-04-08 07:44:54Z bobstayton $
10 ********************************************************************
12 This file is part of the XSL DocBook Stylesheet distribution.
13 See ../README or http://docbook.sf.net/release/xsl/current/ for
14 copyright and other information.
16 ******************************************************************** -->
18 <xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Note: namesp. cut : stripped namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Note: namesp. cut : processing stripped document</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
19 <!-- * Get a title for current doc so that we let the user -->
20 <!-- * know what document we are processing at this point. -->
21 <xsl:variable name="doc.title">
22 <xsl:call-template name="get.doc.title"/>
25 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
26 toss the namespace and continue. Use the docbook5 namespaced
27 stylesheets for DocBook5 if you don't want to use this feature.-->
28 <!-- include extra test for Xalan quirk -->
29 <xsl:when test="false()"/>
32 <xsl:when test="$rootid != ''">
34 <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
35 <xsl:message terminate="yes">
36 <xsl:text>ID '</xsl:text>
37 <xsl:value-of select="$rootid"/>
38 <xsl:text>' not found in document.</xsl:text>
42 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
43 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
45 <xsl:if test="$collect.xref.targets != 'only'">
46 <xsl:message>Formatting from <xsl:value-of select="$rootid"/></xsl:message>
47 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
48 <xsl:call-template name="etoc"/>
49 <xsl:call-template name="plugin.xml"/>
50 <xsl:call-template name="helpidx"/>
56 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
57 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
59 <xsl:if test="$collect.xref.targets != 'only'">
60 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
61 <xsl:call-template name="etoc"/>
62 <xsl:call-template name="plugin.xml"/>
63 <xsl:call-template name="helpidx"/>
71 <xsl:template name="etoc">
72 <xsl:call-template name="write.chunk">
73 <xsl:with-param name="filename">
74 <xsl:if test="$manifest.in.base.dir != 0">
75 <xsl:value-of select="$base.dir"/>
77 <xsl:value-of select="'toc.xml'"/>
79 <xsl:with-param name="method" select="'xml'"/>
80 <xsl:with-param name="encoding" select="'utf-8'"/>
81 <xsl:with-param name="indent" select="'yes'"/>
82 <xsl:with-param name="quiet" select="$chunk.quietly"/>
83 <xsl:with-param name="content">
86 <xsl:when test="$rootid != ''">
87 <xsl:variable name="title">
88 <xsl:if test="$eclipse.autolabel=1">
89 <xsl:variable name="label.markup">
90 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="label.markup"/>
92 <xsl:if test="normalize-space($label.markup)">
93 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
96 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="title.markup"/>
98 <xsl:variable name="href">
99 <xsl:call-template name="href.target.with.base.dir">
100 <xsl:with-param name="object" select="key('id',$rootid)"/>
104 <toc label="{normalize-space($title)}" topic="{$href}">
105 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]/*" mode="etoc"/>
110 <xsl:variable name="title">
111 <xsl:if test="$eclipse.autolabel=1">
112 <xsl:variable name="label.markup">
113 <xsl:apply-templates select="$profiled-nodes/*" mode="label.markup"/>
115 <xsl:if test="normalize-space($label.markup)">
116 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
119 <xsl:apply-templates select="$profiled-nodes/*" mode="title.markup"/>
121 <xsl:variable name="href">
122 <xsl:call-template name="href.target.with.base.dir">
123 <xsl:with-param name="object" select="$profiled-nodes"/>
127 <toc label="{normalize-space($title)}" topic="{$href}">
128 <xsl:apply-templates select="$profiled-nodes/*/*" mode="etoc"/>
137 <xsl:template match="book|part|reference|preface|chapter|bibliography|appendix|article|glossary|section|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv|index" mode="etoc">
138 <xsl:variable name="title">
139 <xsl:if test="$eclipse.autolabel=1">
140 <xsl:variable name="label.markup">
141 <xsl:apply-templates select="." mode="label.markup"/>
143 <xsl:if test="normalize-space($label.markup)">
144 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
147 <xsl:apply-templates select="." mode="title.markup"/>
150 <xsl:variable name="href">
151 <xsl:call-template name="href.target.with.base.dir">
152 <xsl:with-param name="context" select="/"/> <!-- Generate links relative to the location of root file/toc.xml file -->
156 <topic label="{normalize-space($title)}" href="{$href}">
157 <xsl:apply-templates select="part|reference|preface|chapter|bibliography|appendix|article|glossary|section|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv|index" mode="etoc"/>
162 <xsl:template match="text()" mode="etoc"/>
164 <xsl:template name="plugin.xml">
165 <xsl:call-template name="write.chunk">
166 <xsl:with-param name="filename">
167 <xsl:if test="$manifest.in.base.dir != 0">
168 <xsl:value-of select="$base.dir"/>
170 <xsl:value-of select="'plugin.xml'"/>
172 <xsl:with-param name="method" select="'xml'"/>
173 <xsl:with-param name="encoding" select="'utf-8'"/>
174 <xsl:with-param name="indent" select="'yes'"/>
175 <xsl:with-param name="quiet" select="$chunk.quietly"/>
176 <xsl:with-param name="content">
177 <plugin name="{$eclipse.plugin.name}" id="{$eclipse.plugin.id}" version="1.0" provider-name="{$eclipse.plugin.provider}">
179 <extension point="org.eclipse.help.toc">
180 <toc file="toc.xml" primary="true"/>
182 <extension point="org.eclipse.help.index">
183 <index file="index.xml"/>
190 <!-- ==================================================================== -->
191 <!-- The following templates come from the javahelp xsls with modifications needed to make them generate and ecilpse index.xml file -->
193 <xsl:template name="helpidx">
194 <xsl:call-template name="write.chunk.with.doctype">
195 <xsl:with-param name="filename" select="concat($base.dir, 'index.xml')"/>
196 <xsl:with-param name="method" select="'xml'"/>
197 <xsl:with-param name="indent" select="'yes'"/>
198 <xsl:with-param name="doctype-public" select="''"/>
199 <xsl:with-param name="doctype-system" select="''"/>
200 <xsl:with-param name="encoding" select="'utf-8'"/>
201 <xsl:with-param name="quiet" select="$chunk.quietly"/>
202 <xsl:with-param name="content">
203 <xsl:call-template name="helpidx.content"/>
208 <xsl:template name="helpidx.content">
211 <xsl:when test="$rootid != ''">
212 <xsl:apply-templates select="key('id',$rootid)//indexterm" mode="idx">
213 <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = '']))"/>
214 <xsl:sort select="normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = '']))"/>
215 <xsl:sort select="normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = '']))"/>
216 </xsl:apply-templates>
219 <xsl:apply-templates select="//indexterm" mode="idx">
220 <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = '']))"/>
221 <xsl:sort select="normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = '']))"/>
222 <xsl:sort select="normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = '']))"/>
223 </xsl:apply-templates>
229 <xsl:template match="indexterm[@class='endofrange']" mode="idx"/>
231 <xsl:template match="indexterm|primary|secondary|tertiary" mode="idx">
233 <xsl:variable name="href">
234 <xsl:call-template name="href.target.with.base.dir">
235 <xsl:with-param name="context" select="/"/> <!-- Generate links relative to the location of root file/toc.xml file -->
239 <xsl:variable name="text">
240 <xsl:value-of select="normalize-space(.)"/>
241 <xsl:if test="following-sibling::*[1][self::see]">
242 <xsl:text> (</xsl:text><xsl:call-template name="gentext">
243 <xsl:with-param name="key" select="'see'"/>
244 </xsl:call-template><xsl:text> </xsl:text>
245 <xsl:value-of select="following-sibling::*[1][self::see]"/>)</xsl:if>
249 <xsl:when test="self::indexterm">
250 <xsl:apply-templates select="primary" mode="idx"/>
252 <xsl:when test="self::primary">
253 <entry keyword="{$text}">
254 <topic href="{$href}"/>
255 <xsl:apply-templates select="following-sibling::secondary" mode="idx"/>
259 <entry keyword="{$text}">
260 <topic href="{$href}"/>
261 <xsl:apply-templates select="following-sibling::tertiary" mode="idx"/>
267 <!-- ==================================================================== -->