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

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

It is not easier to see error/warning in the output from the docbook.

  • 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<xsl:param name="chunker.message.nofilename">1</xsl:param>
59
60<!-- (MM20040315) base.dir and root.filename are coming from the ant-build-docbook.xml -->
61<xsl:param name="base.dir">@base.dir@/</xsl:param>
62<xsl:param name="root.filename">@root.filename@</xsl:param>
63
64<!-- doc.revision and doc.last.modified -->
65<xsl:param name="doc.revision">@doc.revision@</xsl:param>
66<xsl:param name="doc.last.modified">@doc.last.modified@</xsl:param>
67<xsl:param name="base.version">@base.version@</xsl:param>
68
69<!-- convert url-only references to a format that is wrappable -->
70
71<xsl:template match="ulink" name="ulink">
72  <xsl:choose>
73  <xsl:when test="count(child::node())=0">
74  <a>
75      <xsl:if test="@id">
76        <xsl:attribute name="name">
77          <xsl:value-of select="@id"/>
78        </xsl:attribute>
79      </xsl:if>
80      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
81      <xsl:if test="$ulink.target != ''">
82        <xsl:attribute name="target">
83          <xsl:value-of select="$ulink.target"/>
84        </xsl:attribute>
85      </xsl:if> 
86    <xsl:if test="count(child::node())=0">
87        <xsl:call-template name="insertInvisibleBreaks">
88            <xsl:with-param name="url" select="@url" />
89            <xsl:with-param name="breakat" select="translate(@url, '/-_:', '____')" />
90        </xsl:call-template>
91    </xsl:if>
92  </a>
93  </xsl:when>
94  <xsl:otherwise>
95  <xsl:apply-imports/>
96  </xsl:otherwise>
97  </xsl:choose>
98</xsl:template> 
99
100<xsl:template name="insertInvisibleBreaks">
101    <xsl:param name="url" />
102    <xsl:param name="breakat" />
103    <!-- <xsl:message><xsl:value-of select="concat('param:', $url, $breakat)" /></xsl:message> -->
104    <xsl:choose>
105        <xsl:when test="contains($breakat, '_')">
106            <xsl:value-of select="substring($url, 1, string-length(substring-before($breakat, '_'))+1)" /><wbr/>
107            <xsl:call-template name="insertInvisibleBreaks">
108                <xsl:with-param name="url" select="substring($url, string-length(substring-before($breakat, '_'))+2)"/>
109                <xsl:with-param name="breakat" select="substring($breakat, string-length(substring-before($breakat, '_'))+2)"/>
110            </xsl:call-template>
111        </xsl:when>
112        <xsl:otherwise>
113            <xsl:value-of select="$url" />
114        </xsl:otherwise>
115    </xsl:choose>
116</xsl:template>
117
118<!-- Base specific templates -->
119
120<xsl:template match="helptext">
121  <xsl:choose>
122    <xsl:when test="@webonly = '0'"> 
123      <xsl:apply-templates />
124    </xsl:when>
125  </xsl:choose>
126</xsl:template>
127
128<xsl:template match="seeother|other">
129</xsl:template>
130
131<xsl:template match="nohelp">
132  <xsl:apply-templates />
133</xsl:template>
134
135<xsl:template name="user.footer.navigation">
136  <div 
137    class="navfooter"
138    align="left">
139    <p>
140    <i>
141      <xsl:if test="$doc.revision" >
142        Version: <xsl:value-of select="$base.version"/> (build #<xsl:value-of select="$doc.revision"/>)<br/>
143      </xsl:if>
144      <xsl:if test="$doc.last.modified" >
145        Book last modified: <xsl:value-of select="$doc.last.modified" />
146      </xsl:if>
147    </i></p>
148  </div>
149</xsl:template>
150
151  <xsl:template name="convertpath">
152    <xsl:param name="path" select="''" />
153    <xsl:choose>
154      <xsl:when test="contains($path, '/')">
155        <xsl:text>../</xsl:text>
156        <xsl:call-template name="convertpath">
157          <xsl:with-param name="path" select="substring-after($path, '/')" />
158        </xsl:call-template>
159      </xsl:when>
160    </xsl:choose>
161  </xsl:template>
162
163  <xsl:template name="pathtorootdir">
164    <xsl:variable name="dir">
165      <xsl:call-template name="dbhtml-dir">
166        <xsl:with-param name="context" select="." />
167      </xsl:call-template>
168    </xsl:variable>
169    <xsl:call-template name="convertpath">
170      <xsl:with-param name="path" select="$dir" />
171    </xsl:call-template>
172  </xsl:template>
173
174  <xsl:template name="output.html.stylesheets">
175    <xsl:param name="stylesheets" select="''" />
176    <xsl:variable name="pathtorootdir">
177      <xsl:call-template name="pathtorootdir" />
178    </xsl:variable>
179    <xsl:choose>
180      <xsl:when test="contains($stylesheets, ' ')">
181        <link rel="stylesheet"
182          href="{substring-before(concat($pathtorootdir, $stylesheets), ' ')}">
183          <xsl:if test="$html.stylesheet.type != ''">
184            <xsl:attribute name="type">
185              <xsl:value-of select="$html.stylesheet.type" />
186            </xsl:attribute>
187          </xsl:if>
188        </link>
189        <xsl:call-template name="output.html.stylesheets">
190          <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')" />
191        </xsl:call-template>
192      </xsl:when>
193      <xsl:when test="$stylesheets != ''">
194        <link rel="stylesheet" href="{concat($pathtorootdir,$stylesheets)}">
195          <xsl:if test="$html.stylesheet.type != ''">
196            <xsl:attribute name="type">
197              <xsl:value-of select="$html.stylesheet.type" />
198            </xsl:attribute>
199          </xsl:if>
200        </link>
201      </xsl:when>
202    </xsl:choose>
203  </xsl:template>
204 
205  <xsl:template name="admon.graphic">
206    <xsl:param name="node" select="." />
207    <xsl:variable name="pathtorootdir">
208      <xsl:call-template name="pathtorootdir"/>
209    </xsl:variable>
210    <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path)" />
211    <xsl:choose>
212      <xsl:when test="local-name($node)='note'">note</xsl:when>
213      <xsl:when test="local-name($node)='warning'">warning</xsl:when>
214      <xsl:when test="local-name($node)='caution'">caution</xsl:when>
215      <xsl:when test="local-name($node)='tip'">tip</xsl:when>
216      <xsl:when test="local-name($node)='important'">important</xsl:when>
217      <xsl:otherwise>note</xsl:otherwise>
218    </xsl:choose>
219    <xsl:value-of select="$admon.graphics.extension" />
220  </xsl:template>
221
222</xsl:stylesheet>
223
224
Note: See TracBrowser for help on using the repository browser.