VirtualBox

source: vbox/trunk/doc/manual/docbook2latex.xsl@ 31876

Last change on this file since 31876 was 31761, checked in by vboxsync, 14 years ago

OSE header fixes

File size: 24.1 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 docbook2latex.xslt:
5 translates a DocBook XML source into a LaTeX source file,
6 which can be processed with pdflatex to produce a
7 pretty PDF file.
8
9 Note: In the LaTeX output, this XSLT encodes all quotes
10 with \QUOTE{} commands, which are not defined in this
11 file. This is because XSLT does not support regular
12 expressions natively and therefore it is rather difficult
13 to implement proper "pretty quotes" (different glyphs for
14 opening and closing quotes) in XSLT. The doc/manual/
15 makefile solves this by running sed over the LaTeX source
16 once more, replacing all \QUOTE{} commands with
17 \OQ{} and \CQ{} commands, which _are_ defined to the
18 pretty quotes for English in the LaTeX output generated
19 by this XSLT (see below).
20
21 Copyright (C) 2006-2010 Oracle Corporation
22
23 This file is part of VirtualBox Open Source Edition (OSE), as
24 available from http://www.virtualbox.org. This file is free software;
25 you can redistribute it and/or modify it under the terms of the GNU
26 General Public License (GPL) as published by the Free Software
27 Foundation, in version 2 as it comes in the "COPYING" file of the
28 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
29 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
30 -->
31
32<xsl:stylesheet
33 version="1.0"
34 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
35 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
36 xmlns:str="http://xsltsl.org/string"
37>
38
39 <xsl:import href="string.xsl"/>
40
41 <xsl:variable name="g_nlsChapter">
42 <xsl:choose>
43 <xsl:when test="$TARGETLANG='de_DE'">Kapitel</xsl:when>
44 <xsl:when test="$TARGETLANG='fr_FR'">chapitre</xsl:when>
45 <xsl:when test="$TARGETLANG='en_US'">chapter</xsl:when>
46 <xsl:otherwise>
47 <xsl:message terminate="yes"><xsl:value-of select="concat('Invalid language ', $TARGETLANG)" /></xsl:message>
48 </xsl:otherwise>
49 </xsl:choose>
50 </xsl:variable>
51
52 <xsl:variable name="g_nlsPage">
53 <xsl:choose>
54 <xsl:when test="$TARGETLANG='de_DE'">auf Seite</xsl:when>
55 <xsl:when test="$TARGETLANG='fr_FR'">page</xsl:when>
56 <xsl:when test="$TARGETLANG='en_US'">page</xsl:when>
57 <xsl:otherwise>
58 <xsl:message terminate="yes"><xsl:value-of select="concat('Invalid language ', $TARGETLANG)" /></xsl:message>
59 </xsl:otherwise>
60 </xsl:choose>
61 </xsl:variable>
62
63 <xsl:variable name="g_nlsNote">
64 <xsl:choose>
65 <xsl:when test="$TARGETLANG='de_DE'">Hinweis</xsl:when>
66 <xsl:when test="$TARGETLANG='fr_FR'">Note</xsl:when>
67 <xsl:when test="$TARGETLANG='en_US'">Note</xsl:when>
68 <xsl:otherwise>
69 <xsl:message terminate="yes"><xsl:value-of select="concat('Invalid language ', $TARGETLANG)" /></xsl:message>
70 </xsl:otherwise>
71 </xsl:choose>
72 </xsl:variable>
73
74 <xsl:variable name="g_nlsWarning">
75 <xsl:choose>
76 <xsl:when test="$TARGETLANG='de_DE'">Warnung</xsl:when>
77 <xsl:when test="$TARGETLANG='fr_FR'">Avertissement</xsl:when>
78 <xsl:when test="$TARGETLANG='en_US'">Warning</xsl:when>
79 <xsl:otherwise>
80 <xsl:message terminate="yes"><xsl:value-of select="concat('Invalid language ', $TARGETLANG)" /></xsl:message>
81 </xsl:otherwise>
82 </xsl:choose>
83 </xsl:variable>
84
85 <xsl:output method="text"/>
86
87 <xsl:strip-space elements="*"/>
88
89 <xsl:template match="/book">
90 <xsl:text>
91\documentclass[oneside,a4paper,10pt,DIV10]{scrbook}
92\usepackage{geometry}
93\geometry{top=3cm,bottom=4cm}
94\usepackage{ucs}
95\usepackage[utf8x]{inputenc}
96\usepackage[T1]{fontenc}
97\usepackage{tabulary}
98\usepackage[pdftex,
99 a4paper,
100 colorlinks=true,
101 linkcolor=blue,
102 bookmarksnumbered,
103 bookmarksopen=true,
104 bookmarksopenlevel=0,
105 hyperfootnotes=false,
106 plainpages=false,
107 pdfpagelabels
108 ]{hyperref}
109
110\usepackage{nameref}
111\usepackage{graphicx}
112\usepackage{fancybox}
113\usepackage{fancyvrb}
114\usepackage{alltt}
115\usepackage{color}
116
117</xsl:text>
118 <xsl:if test="$TARGETLANG='de_DE'">\usepackage[ngerman]{babel}&#10;\PrerenderUnicode{ü}</xsl:if>
119<!-- <xsl:if test="$TARGETLANG='fr_FR'">\usepackage[french]{babel}&#10;\FrenchItemizeSpacingfalse&#10;\renewcommand{\FrenchLabelItem}{\textbullet}</xsl:if>
120 this command is no longer understood by TexLive2008
121 -->
122 <xsl:text>
123
124% use Palatino as serif font:
125% \usepackage{mathpazo}
126\usepackage{charter}
127% use Helvetica as sans-serif font:
128\usepackage{helvet}
129
130% use Bera Mono (a variant of Bitstream Vera Mono) as typewriter font
131% (requires texlive-fontsextra)
132\usepackage[scaled]{beramono}
133% previously: use Courier as typewriter font:
134% \usepackage{courier}
135
136\definecolor{colNote}{rgb}{0,0,0}
137\definecolor{colWarning}{rgb}{0,0,0}
138\definecolor{colScreenFrame}{rgb}{0,0,0}
139\definecolor{colScreenText}{rgb}{0,0,0}
140
141% number headings down to this level
142\setcounter{secnumdepth}{3}
143% more space for the section numbers
144\makeatletter
145\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.5em}}
146\renewcommand*\l@subsection{\@dottedtocline{2}{4.0em}{4.1em}}
147\renewcommand*\l@subsubsection{\@dottedtocline{3}{7.4em}{4.1em}}
148\makeatother
149
150% more tolerance at 2nd wrap stage:
151\tolerance = 1000
152% allow 3rd wrap stage:
153\emergencystretch = 10pt
154% no Schusterjungen:
155\clubpenalty = 10000
156% no Hurenkinder:
157\widowpenalty = 10000
158\displaywidowpenalty = 10000
159% max pdf compression:
160\pdfcompresslevel9
161
162% opening and closing quotes: the OQ and CQ macros define this (and the makefile employs some sed magic also)
163</xsl:text>
164 <xsl:choose>
165 <xsl:when test="$TARGETLANG='de_DE'">
166 <xsl:text>\newcommand\OQ{\texorpdfstring{\glqq}{"}}&#10;\newcommand\CQ{\texorpdfstring{\grqq}{"}}&#10;</xsl:text>
167 </xsl:when>
168 <xsl:when test="$TARGETLANG='fr_FR'">
169 <xsl:text>\newcommand\OQ{\texorpdfstring{``}{"}}&#10;\newcommand\CQ{\texorpdfstring{''}{"}}&#10;</xsl:text>
170 </xsl:when>
171 <xsl:when test="$TARGETLANG='en_US'">
172 <xsl:text>\newcommand\OQ{\texorpdfstring{``}{"}}&#10;\newcommand\CQ{\texorpdfstring{''}{"}}&#10;</xsl:text>
173 </xsl:when>
174 <xsl:otherwise>
175 <xsl:message terminate="yes"><xsl:value-of select="concat('Invalid language ', $TARGETLANG)" /></xsl:message>
176 </xsl:otherwise>
177 </xsl:choose>
178
179 <xsl:apply-templates />
180
181 <xsl:text>
182\end{document}
183 </xsl:text>
184
185 </xsl:template>
186
187 <xsl:template match="bookinfo">
188 <xsl:apply-templates />
189 <xsl:text>&#x0a;\newcommand\docbookbookinfocopyright{\copyright{} \docbookbookinfocopyrightyear{} \docbookbookinfocopyrightholder{}}&#x0a;
190\author{ \docbooktitleedition \\ %
191\\ %
192</xsl:text>
193 <xsl:if test="//bookinfo/address">
194 <xsl:text>\docbookbookinfoaddress \\ %
195\\ %
196</xsl:text>
197 </xsl:if>
198 <xsl:text>\docbookbookinfocopyright \\ %
199}
200
201\title{\docbooktitle \\
202\docbooksubtitle}
203% \subtitle{\docbooksubtitle}
204\hypersetup{pdfauthor=\docbookcorpauthor}
205\hypersetup{pdftitle=\docbooktitle{} \docbooksubtitle{}}
206
207\hyphenation{da-ta-ba-ses}
208\hyphenation{deb-conf}
209\hyphenation{VirtualBox}
210
211\begin{document}
212% \maketitle
213%\begin{titlepage}
214\thispagestyle{empty}
215\begin{minipage}{\textwidth}
216\begin{center}
217\includegraphics[width=4cm]{images/vboxlogo.png}
218\end{center}%
219\vspace{10mm}
220
221{\fontsize{40pt}{40pt}\selectfont\rmfamily\bfseries%
222\begin{center}
223\docbooktitle
224\end{center}%
225\vspace{10mm}
226}
227
228{\fontsize{30pt}{30pt}\selectfont\rmfamily\bfseries%
229\begin{center}
230\docbooksubtitle
231\end{center}%
232\vspace{10mm}
233}
234
235{\fontsize{16pt}{20pt}\selectfont\rmfamily%
236\begin{center}
237\docbooktitleedition
238
239\vspace{2mm}
240
241\docbookbookinfocopyright
242
243\vspace{2mm}
244
245\docbookbookinfoaddress
246\end{center}%
247}
248
249%\end{titlepage}
250\end{minipage}
251
252\tableofcontents
253 </xsl:text>
254 </xsl:template>
255
256 <xsl:template match="subtitle">
257 <xsl:choose>
258 <xsl:when test="name(..)='bookinfo'">
259 <xsl:text>\newcommand\docbooksubtitle{</xsl:text>
260 <xsl:apply-templates />
261 <xsl:text>}</xsl:text>
262 </xsl:when>
263 </xsl:choose>
264 </xsl:template>
265
266 <xsl:template match="title">
267 <xsl:choose>
268 <xsl:when test="name(..)='bookinfo'">
269 <xsl:text>\newcommand\docbooktitle{</xsl:text>
270 <xsl:apply-templates />
271 <xsl:text>}</xsl:text>
272 </xsl:when>
273 <xsl:when test="name(..)='chapter'">
274 <xsl:text>&#x0a;&#x0a;\chapter{</xsl:text>
275 <xsl:apply-templates />
276 <xsl:text>}</xsl:text>
277 </xsl:when>
278 <xsl:when test="name(..)='sect1'">
279 <xsl:text>&#x0a;&#x0a;\section{</xsl:text>
280 <xsl:apply-templates />
281 <xsl:text>}</xsl:text>
282 </xsl:when>
283 <xsl:when test="name(..)='sect2'">
284 <xsl:text>&#x0a;&#x0a;\subsection{</xsl:text>
285 <xsl:apply-templates />
286 <xsl:text>}</xsl:text>
287 </xsl:when>
288 <xsl:when test="name(..)='sect3'">
289 <xsl:text>&#x0a;&#x0a;\subsubsection{</xsl:text>
290 <xsl:apply-templates />
291 <xsl:text>}</xsl:text>
292 </xsl:when>
293 <xsl:when test="name(..)='sect4'">
294 <xsl:text>&#x0a;&#x0a;\paragraph{</xsl:text>
295 <xsl:apply-templates />
296 <xsl:text>}</xsl:text>
297 </xsl:when>
298 <xsl:when test="name(..)='sect5'">
299 <xsl:text>&#x0a;&#x0a;\subparagraph{</xsl:text>
300 <xsl:apply-templates />
301 <xsl:text>}</xsl:text>
302 </xsl:when>
303 <xsl:when test="name(..)='appendix'">
304 <xsl:text>&#x0a;&#x0a;\chapter{</xsl:text>
305 <xsl:apply-templates />
306 <xsl:text>}</xsl:text>
307 </xsl:when>
308 <xsl:when test="name(..)='glossdiv'">
309 <xsl:text>&#x0a;&#x0a;\section*{</xsl:text>
310 <xsl:apply-templates />
311 <xsl:text>}</xsl:text>
312 </xsl:when>
313 </xsl:choose>
314 <xsl:variable name="refid" select="(@id) | (../@id)" />
315 <xsl:if test="$refid">
316 <xsl:value-of select="concat('&#x0a;\label{', $refid, '}')" />
317 </xsl:if>
318 <xsl:text>&#x0a;</xsl:text>
319 </xsl:template>
320
321 <xsl:template match="edition">
322 <xsl:choose>
323 <xsl:when test="name(..)='bookinfo'">
324 <xsl:text>\newcommand\docbooktitleedition{</xsl:text>
325 <xsl:apply-templates />
326 <xsl:text>}&#x0a;</xsl:text>
327 </xsl:when>
328 </xsl:choose>
329 </xsl:template>
330
331 <xsl:template match="corpauthor">
332 <xsl:choose>
333 <xsl:when test="name(..)='bookinfo'">
334 <xsl:text>\newcommand\docbookcorpauthor{</xsl:text>
335 <xsl:apply-templates />
336 <xsl:text>}&#x0a;</xsl:text>
337 </xsl:when>
338 </xsl:choose>
339 </xsl:template>
340
341 <xsl:template match="address">
342 <xsl:choose>
343 <xsl:when test="name(..)='bookinfo'">
344 <xsl:text>\newcommand\docbookbookinfoaddress{</xsl:text>
345 <xsl:apply-templates />
346 <xsl:text>}&#x0a;</xsl:text>
347 </xsl:when>
348 </xsl:choose>
349 </xsl:template>
350
351 <xsl:template match="year">
352 <xsl:choose>
353 <xsl:when test="name(..)='copyright'">
354 <xsl:text>\newcommand\docbookbookinfocopyrightyear{</xsl:text>
355 <xsl:apply-templates />
356 <xsl:text>}&#x0a;</xsl:text>
357 </xsl:when>
358 </xsl:choose>
359 </xsl:template>
360
361 <xsl:template match="holder">
362 <xsl:choose>
363 <xsl:when test="name(..)='copyright'">
364 <xsl:text>\newcommand\docbookbookinfocopyrightholder{</xsl:text>
365 <xsl:apply-templates />
366 <xsl:text>}&#x0a;</xsl:text>
367 </xsl:when>
368 </xsl:choose>
369 </xsl:template>
370
371 <xsl:template match="glossary">
372 <xsl:text>&#x0a;&#x0a;\backmatter&#x0a;\chapter{Glossary}&#x0a;</xsl:text>
373 <xsl:apply-templates />
374 </xsl:template>
375
376 <xsl:template match="para">
377 <xsl:if test="not(name(..)='footnote' or name(..)='note' or name(..)='warning')">
378 <xsl:text>&#x0a;&#x0a;</xsl:text>
379 </xsl:if>
380 <xsl:apply-templates />
381 </xsl:template>
382
383 <xsl:template match="note">
384 <xsl:value-of select="concat('&#x0a;&#x0a;\vspace{.2cm}&#x0a;&#x0a;\begin{center}\fbox{\begin{minipage}[c]{0.9\textwidth}\color{colNote}\textbf{', $g_nlsNote, ':} ')" />
385 <xsl:apply-templates />
386 <xsl:text>\end{minipage}}\end{center}&#x0a;&#x0a;\vspace{.2cm}&#x0a;&#x0a;</xsl:text>
387 </xsl:template>
388
389 <xsl:template match="warning">
390 <xsl:value-of select="concat('&#x0a;&#x0a;\vspace{.2cm}&#x0a;&#x0a;\begin{center}\fbox{\begin{minipage}[c]{0.9\textwidth}\color{colWarning}\textbf{', $g_nlsWarning, ':} ')" />
391 <xsl:apply-templates />
392 <xsl:text>\end{minipage}}\end{center}&#x0a;&#x0a;\vspace{.2cm}&#x0a;&#x0a;</xsl:text>
393 </xsl:template>
394
395 <xsl:template match="screen">
396 <xsl:text>&#x0a;&#x0a;\begin{Verbatim}[fontsize=\footnotesize]&#x0a;</xsl:text>
397 <xsl:apply-templates />
398 <xsl:text>&#x0a;\end{Verbatim}&#x0a;</xsl:text>
399 </xsl:template>
400
401 <xsl:template match="programlisting">
402 <xsl:text>&#x0a;&#x0a;{\small\begin{alltt}&#x0a;</xsl:text>
403 <xsl:apply-templates />
404 <xsl:text>&#x0a;\end{alltt}}&#x0a;</xsl:text>
405 </xsl:template>
406
407 <xsl:template match="footnote">
408 <xsl:text>\footnote{</xsl:text>
409 <xsl:apply-templates />
410 <xsl:text>}</xsl:text>
411 </xsl:template>
412
413 <xsl:template match="tgroup">
414 <xsl:text>&#x0a;&#x0a;\begin{center}&#x0a;\begin{tabulary}{.9\textwidth}[]{|L|L|}&#x0a;\hline&#x0a;</xsl:text>
415 <xsl:apply-templates />
416 <xsl:text>&#x0a;\end{tabulary}&#x0a;\end{center}&#x0a;</xsl:text>
417 </xsl:template>
418
419 <xsl:template match="row">
420 <xsl:apply-templates />
421 <xsl:text>&#x0a;\\ \hline&#x0a;</xsl:text>
422 </xsl:template>
423
424 <xsl:template match="entry">
425 <xsl:if test="not(position()=1)">
426 <xsl:text> &amp; </xsl:text>
427 </xsl:if>
428 <xsl:apply-templates />
429 </xsl:template>
430
431 <xsl:template match="itemizedlist">
432 <xsl:text>&#x0a;&#x0a;\begin{itemize}&#x0a;</xsl:text>
433 <xsl:apply-templates />
434 <xsl:text>&#x0a;\end{itemize}&#x0a;</xsl:text>
435 </xsl:template>
436
437 <xsl:template match="orderedlist">
438 <xsl:text>&#x0a;&#x0a;\begin{enumerate}&#x0a;</xsl:text>
439 <xsl:apply-templates />
440 <xsl:text>&#x0a;\end{enumerate}&#x0a;</xsl:text>
441 </xsl:template>
442
443 <xsl:template match="listitem">
444 <xsl:text>&#x0a;&#x0a;\item </xsl:text>
445 <xsl:apply-templates />
446 <xsl:text>&#x0a;</xsl:text>
447 </xsl:template>
448
449 <xsl:template match="glossterm">
450 <xsl:variable name="refid" select="(@id)" />
451 <xsl:if test="$refid">
452 <xsl:value-of select="concat('&#x0a;\label{', $refid, '}')" />
453 </xsl:if>
454 <xsl:text>&#x0a;&#x0a;\item[</xsl:text>
455 <xsl:apply-templates />
456 <xsl:text>]</xsl:text>
457 </xsl:template>
458
459 <xsl:template match="glosslist | glossdiv">
460 <xsl:text>&#x0a;&#x0a;\begin{description}&#x0a;</xsl:text>
461 <xsl:apply-templates />
462 <xsl:text>&#x0a;\end{description}&#x0a;</xsl:text>
463 </xsl:template>
464
465 <xsl:template match="superscript">
466 <xsl:variable name="contents">
467 <xsl:apply-templates />
468 </xsl:variable>
469 <xsl:value-of select="concat('\texorpdfstring{\textsuperscript{', $contents, '}}{', $contents, '}')" />
470 </xsl:template>
471
472 <xsl:template match="emphasis">
473 <xsl:choose>
474 <xsl:when test="@role='bold'">
475 <xsl:text>\textbf{</xsl:text>
476 </xsl:when>
477 <xsl:otherwise>
478 <xsl:text>\textit{</xsl:text>
479 </xsl:otherwise>
480 </xsl:choose>
481 <xsl:apply-templates />
482 <xsl:text>}</xsl:text>
483 </xsl:template>
484
485 <xsl:template match="computeroutput | code">
486 <xsl:text>\texttt{</xsl:text>
487 <xsl:apply-templates />
488 <xsl:text>}</xsl:text>
489 </xsl:template>
490
491 <xsl:template match="ulink">
492 <xsl:text>\url{</xsl:text>
493 <xsl:apply-templates />
494 <xsl:text>}</xsl:text>
495 </xsl:template>
496
497 <xsl:template match="xref">
498 <xsl:choose>
499 <xsl:when test="@xreflabel">
500 <xsl:value-of select="concat('\hyperref[', @linkend, ']{', @xreflabel, '}')" />
501 </xsl:when>
502 <xsl:when test="@apiref='yes'">
503 <xsl:value-of select="concat('\hyperref[', @linkend, ']{')" />
504 <xsl:apply-templates />
505 <xsl:value-of select="'}'" />
506 </xsl:when>
507 <xsl:otherwise>
508 <xsl:value-of select="concat($g_nlsChapter, ' \ref{', @linkend, '}, \textit{\nameref{', @linkend, '}}, ', $g_nlsPage, ' \pageref{', @linkend, '}')" />
509 </xsl:otherwise>
510 </xsl:choose>
511 </xsl:template>
512
513 <!-- for some reason, DocBook insists of having image data nested this way always:
514 mediaobject -> imageobject -> imagedata
515 but only imagedata is interesting -->
516 <xsl:template match="imagedata">
517 <xsl:if test="@align='center'">
518 <xsl:text>\begin{center}</xsl:text>
519 </xsl:if>
520 <xsl:value-of select="concat('&#x0a;\includegraphics[width=', @width, ']{', @fileref, '}&#x0a;')" />
521 <xsl:apply-templates />
522 <xsl:if test="@align='center'">
523 <xsl:text>\end{center}</xsl:text>
524 </xsl:if>
525 </xsl:template>
526
527 <xsl:template match="//text()">
528 <xsl:variable name="subst1">
529 <xsl:call-template name="str:subst">
530 <xsl:with-param name="text" select="." />
531 <xsl:with-param name="replace" select="'\'" />
532 <xsl:with-param name="with" select="'\textbackslash{}'" />
533 <xsl:with-param name="disable-output-escaping" select="no" />
534 </xsl:call-template>
535 </xsl:variable>
536 <xsl:choose>
537 <xsl:when test="(name(..)='screen') or (name(../..)='screen')">
538 <xsl:value-of select="." />
539 </xsl:when>
540 <xsl:when test="(name(..)='computeroutput') or (name(../..)='computeroutput') or (name(../..)='code') or (name(../..)='code')">
541 <xsl:variable name="subst2">
542 <xsl:call-template name="str:subst">
543 <xsl:with-param name="text" select="$subst1" />
544 <xsl:with-param name="replace" select="'--'" />
545 <xsl:with-param name="with" select="'-{}-'" />
546 <xsl:with-param name="disable-output-escaping" select="no" />
547 </xsl:call-template>
548 </xsl:variable>
549 <xsl:variable name="subst3">
550 <xsl:call-template name="str:subst">
551 <xsl:with-param name="text" select="$subst2" />
552 <xsl:with-param name="replace" select="'_'" />
553 <xsl:with-param name="with" select="'\_'" />
554 <xsl:with-param name="disable-output-escaping" select="no" />
555 </xsl:call-template>
556 </xsl:variable>
557 <xsl:variable name="subst4">
558 <xsl:call-template name="str:subst">
559 <xsl:with-param name="text" select="$subst3" />
560 <xsl:with-param name="replace" select="'$'" />
561 <xsl:with-param name="with" select="'\$'" />
562 <xsl:with-param name="disable-output-escaping" select="no" />
563 </xsl:call-template>
564 </xsl:variable>
565 <xsl:variable name="subst5">
566 <xsl:call-template name="str:subst">
567 <xsl:with-param name="text" select="$subst4" />
568 <xsl:with-param name="replace" select="'%'" />
569 <xsl:with-param name="with" select="'\%'" />
570 <xsl:with-param name="disable-output-escaping" select="no" />
571 </xsl:call-template>
572 </xsl:variable>
573 <xsl:variable name="subst6">
574 <xsl:call-template name="str:subst">
575 <xsl:with-param name="text" select="$subst5" />
576 <xsl:with-param name="replace" select="'#'" />
577 <xsl:with-param name="with" select="'\#'" />
578 <xsl:with-param name="disable-output-escaping" select="no" />
579 </xsl:call-template>
580 </xsl:variable>
581 <xsl:variable name="subst7">
582 <xsl:call-template name="str:subst">
583 <xsl:with-param name="text" select="$subst6" />
584 <xsl:with-param name="replace" select="'~'" />
585 <xsl:with-param name="with" select="'\~'" />
586 <xsl:with-param name="disable-output-escaping" select="no" />
587 </xsl:call-template>
588 </xsl:variable>
589 <xsl:variable name="subst8">
590 <xsl:call-template name="str:subst">
591 <xsl:with-param name="text" select="$subst7" />
592 <xsl:with-param name="replace" select="'&amp;'" />
593 <xsl:with-param name="with" select="'\&amp;'" />
594 <xsl:with-param name="disable-output-escaping" select="no" />
595 </xsl:call-template>
596 </xsl:variable>
597 <xsl:value-of select="$subst8" />
598 </xsl:when>
599 <xsl:when test="(name(..)='address') or (name(../..)='address')">
600 <xsl:variable name="subst2">
601 <xsl:call-template name="str:subst">
602 <xsl:with-param name="text" select="$subst1" />
603 <xsl:with-param name="replace" select="'&#x0a;'" />
604 <xsl:with-param name="with" select="' \\'" />
605 <xsl:with-param name="disable-output-escaping" select="no" />
606 </xsl:call-template>
607 </xsl:variable>
608 <xsl:value-of select="$subst2" />
609 </xsl:when>
610 <xsl:otherwise>
611 <xsl:variable name="subst2">
612 <xsl:call-template name="str:subst">
613 <xsl:with-param name="text" select="$subst1" />
614 <xsl:with-param name="replace" select="'_'" />
615 <xsl:with-param name="with" select="'\_'" />
616 <xsl:with-param name="disable-output-escaping" select="no" />
617 </xsl:call-template>
618 </xsl:variable>
619 <xsl:variable name="subst3">
620 <xsl:call-template name="str:subst">
621 <xsl:with-param name="text" select="$subst2" />
622 <xsl:with-param name="replace" select="'$'" />
623 <xsl:with-param name="with" select="'\$'" />
624 <xsl:with-param name="disable-output-escaping" select="no" />
625 </xsl:call-template>
626 </xsl:variable>
627 <xsl:variable name="subst4">
628 <xsl:call-template name="str:subst">
629 <xsl:with-param name="text" select="$subst3" />
630 <xsl:with-param name="replace" select="'%'" />
631 <xsl:with-param name="with" select="'\%'" />
632 <xsl:with-param name="disable-output-escaping" select="no" />
633 </xsl:call-template>
634 </xsl:variable>
635 <xsl:variable name="subst5">
636 <xsl:call-template name="str:subst">
637 <xsl:with-param name="text" select="$subst4" />
638 <xsl:with-param name="replace" select="'#'" />
639 <xsl:with-param name="with" select="'\#'" />
640 <xsl:with-param name="disable-output-escaping" select="no" />
641 </xsl:call-template>
642 </xsl:variable>
643 <xsl:variable name="subst6">
644 <xsl:call-template name="str:subst">
645 <xsl:with-param name="text" select="$subst5" />
646 <xsl:with-param name="replace" select="'µ'" />
647 <xsl:with-param name="with" select="'$\mu$'" />
648 <xsl:with-param name="disable-output-escaping" select="no" />
649 </xsl:call-template>
650 </xsl:variable>
651 <xsl:variable name="subst7">
652 <xsl:call-template name="str:subst">
653 <xsl:with-param name="text" select="$subst6" />
654 <xsl:with-param name="replace" select="'®'" />
655 <xsl:with-param name="with" select="'\texorpdfstring{\textregistered}{}'" />
656 <xsl:with-param name="disable-output-escaping" select="no" />
657 </xsl:call-template>
658 </xsl:variable>
659 <xsl:variable name="quote">"</xsl:variable>
660 <!-- preparation for pretty quotes: replace all double quotes _outside_ screen
661 sections with "\QUOTE{}" strings, which the makefile will then replace
662 with pretty quotes by invoking sed a few times. Unfortunately there are
663 no regular expressions in XSLT so there's no other way. -->
664 <xsl:variable name="subst8">
665 <xsl:call-template name="str:subst">
666 <xsl:with-param name="text" select="$subst7" />
667 <xsl:with-param name="replace" select="$quote" />
668 <xsl:with-param name="with" select="'\QUOTE{}'" />
669 <xsl:with-param name="disable-output-escaping" select="no" />
670 </xsl:call-template>
671 </xsl:variable>
672 <xsl:variable name="subst9">
673 <xsl:call-template name="str:subst">
674 <xsl:with-param name="text" select="$subst8" />
675 <xsl:with-param name="replace" select="'~'" />
676 <xsl:with-param name="with" select="'\~'" />
677 <xsl:with-param name="disable-output-escaping" select="no" />
678 </xsl:call-template>
679 </xsl:variable>
680 <xsl:variable name="subst10">
681 <xsl:call-template name="str:subst">
682 <xsl:with-param name="text" select="$subst9" />
683 <xsl:with-param name="replace" select="'&amp;'" />
684 <xsl:with-param name="with" select="'\&amp;'" />
685 <xsl:with-param name="disable-output-escaping" select="no" />
686 </xsl:call-template>
687 </xsl:variable>
688 <xsl:value-of select="$subst10" />
689 </xsl:otherwise>
690 </xsl:choose>
691 </xsl:template>
692</xsl:stylesheet>
693
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette