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

Last change on this file since 3283 was 3283, checked in by Jari Häkkinen, 16 years ago

Removing stray carriage returns. Setting proper eol-style.

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