source: trunk/lib/docbook/custom-styles/docbook/plain/xsl/customized.chunked.xsl @ 3307

Last change on this file since 3307 was 3307, checked in by Nicklas Nordborg, 16 years ago

Fixed output of <nohelp> tagged parts in HTML and PDF versions.

  • Property svn:eol-style set to native
File size: 7.6 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                xmlns:date="http://exslt.org/dates-and-times"
5                exclude-result-prefixes="date"
6                version='1.0'>
7
8<xsl:import href="../../../lib/docbook/docbook/xsl/html/chunk.xsl" />
9
10<!-- (MM20040315) xsl parameters moved from ant-build-docbook.xml to here -->
11<xsl:param name="table.borders.with.css" select="1"/>
12<xsl:param name="html.stylesheet">css/docbook.css</xsl:param>
13<xsl:param name="html.stylesheet.type">text/css</xsl:param>       
14<xsl:param name="section.label.includes.component.label" select="1" />         
15<xsl:param name="section.autolabel" select="1" />
16<xsl:param name="section.autolabel.max.depth" select="2" />
17<xsl:param name="chunk.first.sections" select="1" />
18<xsl:param name="chunk.section.depth" select="2" />
19<xsl:param name="chunk.fast" select="1" />
20<xsl:param name="toc.max.depth" select="4"/>
21<xsl:param name="toc.section.depth" select="3" />
22<xsl:param name="generate.section.toc.level" select="1" />
23<xsl:param name="generate.toc">
24appendix  toc,title
25article/appendix  nop
26article   toc,title
27book      toc,title
28chapter   toc,title
29part      toc,title
30preface   toc,title
31qandadiv  toc
32qandaset  toc
33reference toc,title
34sect1     toc
35sect2     toc
36sect3     toc
37sect4     toc
38sect5     toc
39section   toc
40set       toc,title
41</xsl:param>
42<xsl:param name="make.graphic.viewport" select="0"/>
43<xsl:param name="callout.graphics" select="1" />
44<xsl:param name="callout.graphics.path">gfx/admonitions/callouts/</xsl:param>
45<xsl:param name="callout.graphics.extension">.gif</xsl:param>
46<xsl:param name="admon.graphics" select="1"/>
47<xsl:param name="admon.graphics.path">gfx/admonitions/</xsl:param>
48<xsl:param name="admon.graphics.extension">.gif</xsl:param>
49<xsl:param name="admon.style">margin-left: 2em; margin-right: 2em;</xsl:param>
50<xsl:param name="admonition.title.properties">text-align: left</xsl:param>
51
52<xsl:param name="keep.relative.image.uris" select="false"/>
53
54<xsl:param name="use.id.as.filename" select="1"/>
55
56<xsl:param name="chunker.output.encoding">utf-8</xsl:param>
57<xsl:param name="chunker.output.indent">yes</xsl:param>
58
59<!-- (MM20040315) base.dir and root.filename are coming from the ant-build-docbook.xml -->
60<xsl:param name="base.dir">@base.dir@/</xsl:param>
61<xsl:param name="root.filename">@root.filename@</xsl:param>
62
63<!-- doc.revision and doc.last.modified -->
64<xsl:param name="doc.revision">@doc.revision@</xsl:param>
65<xsl:param name="doc.last.modified">@doc.last.modified@</xsl:param>
66<xsl:param name="base.version">@base.version@</xsl:param>
67
68<!-- convert url-only references to a format that is wrappable -->
69
70<xsl:template match="ulink" name="ulink">
71  <xsl:choose>
72  <xsl:when test="count(child::node())=0">
73  <a>
74      <xsl:if test="@id">
75        <xsl:attribute name="name">
76          <xsl:value-of select="@id"/>
77        </xsl:attribute>
78      </xsl:if>
79      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
80      <xsl:if test="$ulink.target != ''">
81        <xsl:attribute name="target">
82          <xsl:value-of select="$ulink.target"/>
83        </xsl:attribute>
84      </xsl:if> 
85    <xsl:if test="count(child::node())=0">
86        <xsl:call-template name="insertInvisibleBreaks">
87            <xsl:with-param name="url" select="@url" />
88            <xsl:with-param name="breakat" select="translate(@url, '/-_:', '____')" />
89        </xsl:call-template>
90    </xsl:if>
91  </a>
92  </xsl:when>
93  <xsl:otherwise>
94  <xsl:apply-imports/>
95  </xsl:otherwise>
96  </xsl:choose>
97</xsl:template> 
98
99<xsl:template name="insertInvisibleBreaks">
100    <xsl:param name="url" />
101    <xsl:param name="breakat" />
102    <!-- <xsl:message><xsl:value-of select="concat('param:', $url, $breakat)" /></xsl:message> -->
103    <xsl:choose>
104        <xsl:when test="contains($breakat, '_')">
105            <xsl:value-of select="substring($url, 1, string-length(substring-before($breakat, '_'))+1)" /><wbr/>
106            <xsl:call-template name="insertInvisibleBreaks">
107                <xsl:with-param name="url" select="substring($url, string-length(substring-before($breakat, '_'))+2)"/>
108                <xsl:with-param name="breakat" select="substring($breakat, string-length(substring-before($breakat, '_'))+2)"/>
109            </xsl:call-template>
110        </xsl:when>
111        <xsl:otherwise>
112            <xsl:value-of select="$url" />
113        </xsl:otherwise>
114    </xsl:choose>
115</xsl:template>
116
117<!-- Base specific templates -->
118
119<xsl:template match="helptext">
120  <xsl:choose>
121    <xsl:when test="@webonly = '0'"> 
122      <xsl:apply-templates />
123    </xsl:when>
124  </xsl:choose>
125</xsl:template>
126
127<xsl:template match="seeother|other">
128</xsl:template>
129
130<xsl:template match="nohelp">
131  <xsl:apply-templates />
132</xsl:template>
133
134<xsl:template name="user.footer.navigation">
135  <div 
136    class="navfooter"
137    align="left">
138    <p>
139    <i>
140      <xsl:if test="$doc.revision" >
141        Version: <xsl:value-of select="$base.version"/> (build #<xsl:value-of select="$doc.revision"/>)<br/>
142      </xsl:if>
143      <xsl:if test="$doc.last.modified" >
144        Book last modified: <xsl:value-of select="$doc.last.modified" />
145      </xsl:if>
146    </i></p>
147  </div>
148</xsl:template>
149
150  <xsl:template name="convertpath">
151    <xsl:param name="path" select="''" />
152    <xsl:choose>
153      <xsl:when test="contains($path, '/')">
154        <xsl:text>../</xsl:text>
155        <xsl:call-template name="convertpath">
156          <xsl:with-param name="path" select="substring-after($path, '/')" />
157        </xsl:call-template>
158      </xsl:when>
159    </xsl:choose>
160  </xsl:template>
161
162  <xsl:template name="pathtorootdir">
163    <xsl:variable name="dir">
164      <xsl:call-template name="dbhtml-dir">
165        <xsl:with-param name="context" select="." />
166      </xsl:call-template>
167    </xsl:variable>
168    <xsl:call-template name="convertpath">
169      <xsl:with-param name="path" select="$dir" />
170    </xsl:call-template>
171  </xsl:template>
172
173  <xsl:template name="output.html.stylesheets">
174    <xsl:param name="stylesheets" select="''" />
175    <xsl:variable name="pathtorootdir">
176      <xsl:call-template name="pathtorootdir" />
177    </xsl:variable>
178    <xsl:choose>
179      <xsl:when test="contains($stylesheets, ' ')">
180        <link rel="stylesheet"
181          href="{substring-before(concat($pathtorootdir, $stylesheets), ' ')}">
182          <xsl:if test="$html.stylesheet.type != ''">
183            <xsl:attribute name="type">
184              <xsl:value-of select="$html.stylesheet.type" />
185            </xsl:attribute>
186          </xsl:if>
187        </link>
188        <xsl:call-template name="output.html.stylesheets">
189          <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')" />
190        </xsl:call-template>
191      </xsl:when>
192      <xsl:when test="$stylesheets != ''">
193        <link rel="stylesheet" href="{concat($pathtorootdir,$stylesheets)}">
194          <xsl:if test="$html.stylesheet.type != ''">
195            <xsl:attribute name="type">
196              <xsl:value-of select="$html.stylesheet.type" />
197            </xsl:attribute>
198          </xsl:if>
199        </link>
200      </xsl:when>
201    </xsl:choose>
202  </xsl:template>
203 
204  <xsl:template name="admon.graphic">
205    <xsl:param name="node" select="." />
206    <xsl:variable name="pathtorootdir">
207      <xsl:call-template name="pathtorootdir"/>
208    </xsl:variable>
209    <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path)" />
210    <xsl:choose>
211      <xsl:when test="local-name($node)='note'">note</xsl:when>
212      <xsl:when test="local-name($node)='warning'">warning</xsl:when>
213      <xsl:when test="local-name($node)='caution'">caution</xsl:when>
214      <xsl:when test="local-name($node)='tip'">tip</xsl:when>
215      <xsl:when test="local-name($node)='important'">important</xsl:when>
216      <xsl:otherwise>note</xsl:otherwise>
217    </xsl:choose>
218    <xsl:value-of select="$admon.graphics.extension" />
219  </xsl:template>
220
221</xsl:stylesheet>
222
223
Note: See TracBrowser for help on using the repository browser.