VirtualBox

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

Last change on this file since 42551 was 42551, checked in by vboxsync, 12 years ago

Main: big API naming cleanup, use all caps acronyms everywhere, including SDK docs
Frontends/VBoxManage: implement guestcontrol execute for new API, disabled by default

File size: 24.5 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-2012 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.9em}}
146\renewcommand*\l@subsection{\@dottedtocline{2}{4.4em}{3.8em}}
147\renewcommand*\l@subsubsection{\@dottedtocline{3}{8.2em}{3.8em}}
148\renewcommand*\@pnumwidth{1.7em}
149\renewcommand*\@tocrmarg{5.0em}
150\makeatother
151
152% more tolerance at 2nd wrap stage:
153\tolerance = 1000
154% allow 3rd wrap stage:
155\emergencystretch = 10pt
156% no Schusterjungen:
157\clubpenalty = 10000
158% no Hurenkinder:
159\widowpenalty = 10000
160\displaywidowpenalty = 10000
161% max pdf compression:
162\pdfcompresslevel9
163
164% opening and closing quotes: the OQ and CQ macros define this (and the makefile employs some sed magic also)
165</xsl:text>
166 <xsl:choose>
167 <xsl:when test="$TARGETLANG='de_DE'">
168 <xsl:text>\newcommand\OQ{\texorpdfstring{\glqq}{"}}&#10;\newcommand\CQ{\texorpdfstring{\grqq}{"}}&#10;</xsl:text>
169 </xsl:when>
170 <xsl:when test="$TARGETLANG='fr_FR'">
171 <xsl:text>\newcommand\OQ{\texorpdfstring{``}{"}}&#10;\newcommand\CQ{\texorpdfstring{''}{"}}&#10;</xsl:text>
172 </xsl:when>
173 <xsl:when test="$TARGETLANG='en_US'">
174 <xsl:text>\newcommand\OQ{\texorpdfstring{``}{"}}&#10;\newcommand\CQ{\texorpdfstring{''}{"}}&#10;</xsl:text>
175 </xsl:when>
176 <xsl:otherwise>
177 <xsl:message terminate="yes"><xsl:value-of select="concat('Invalid language ', $TARGETLANG)" /></xsl:message>
178 </xsl:otherwise>
179 </xsl:choose>
180
181 <xsl:apply-templates />
182
183 <xsl:text>
184\end{document}
185 </xsl:text>
186
187 </xsl:template>
188
189 <xsl:template match="bookinfo">
190 <xsl:apply-templates />
191 <xsl:text>&#x0a;\newcommand\docbookbookinfocopyright{\copyright{} \docbookbookinfocopyrightyear{} \docbookbookinfocopyrightholder{}}&#x0a;
192\author{ \docbooktitleedition \\ %
193\\ %
194</xsl:text>
195 <xsl:if test="//bookinfo/address">
196 <xsl:text>\docbookbookinfoaddress \\ %
197\\ %
198</xsl:text>
199 </xsl:if>
200 <xsl:text>\docbookbookinfocopyright \\ %
201}
202
203\title{\docbooktitle \\
204\docbooksubtitle}
205% \subtitle{\docbooksubtitle}
206\hypersetup{pdfauthor=\docbookcorpauthor}
207\hypersetup{pdftitle=\docbooktitle{} \docbooksubtitle{}}
208
209\hyphenation{da-ta-ba-ses}
210\hyphenation{deb-conf}
211\hyphenation{VirtualBox}
212
213\begin{document}
214% \maketitle
215%\begin{titlepage}
216\thispagestyle{empty}
217\begin{minipage}{\textwidth}
218\begin{center}
219\includegraphics[width=4cm]{images/vboxlogo.png}
220\end{center}%
221\vspace{10mm}
222
223{\fontsize{40pt}{40pt}\selectfont\rmfamily\bfseries%
224\begin{center}
225\docbooktitle
226\end{center}%
227\vspace{10mm}
228}
229
230{\fontsize{30pt}{30pt}\selectfont\rmfamily\bfseries%
231\begin{center}
232\docbooksubtitle
233\end{center}%
234\vspace{10mm}
235}
236
237{\fontsize{16pt}{20pt}\selectfont\rmfamily%
238\begin{center}
239\docbooktitleedition
240
241\vspace{2mm}
242
243\docbookbookinfocopyright
244
245\vspace{2mm}
246
247\docbookbookinfoaddress
248\end{center}%
249}
250
251%\end{titlepage}
252\end{minipage}
253
254\tableofcontents
255 </xsl:text>
256 </xsl:template>
257
258 <xsl:template match="subtitle">
259 <xsl:choose>
260 <xsl:when test="name(..)='bookinfo'">
261 <xsl:text>\newcommand\docbooksubtitle{</xsl:text>
262 <xsl:apply-templates />
263 <xsl:text>}</xsl:text>
264 </xsl:when>
265 </xsl:choose>
266 </xsl:template>
267
268 <xsl:template match="title">
269 <xsl:choose>
270 <xsl:when test="name(..)='bookinfo'">
271 <xsl:text>\newcommand\docbooktitle{</xsl:text>
272 <xsl:apply-templates />
273 <xsl:text>}</xsl:text>
274 </xsl:when>
275 <xsl:when test="name(..)='chapter'">
276 <xsl:text>&#x0a;&#x0a;\chapter{</xsl:text>
277 <xsl:apply-templates />
278 <xsl:text>}</xsl:text>
279 </xsl:when>
280 <xsl:when test="name(..)='sect1'">
281 <xsl:text>&#x0a;&#x0a;\section{</xsl:text>
282 <xsl:apply-templates />
283 <xsl:text>}</xsl:text>
284 </xsl:when>
285 <xsl:when test="name(..)='sect2'">
286 <xsl:text>&#x0a;&#x0a;\subsection{</xsl:text>
287 <xsl:apply-templates />
288 <xsl:text>}</xsl:text>
289 </xsl:when>
290 <xsl:when test="name(..)='sect3'">
291 <xsl:text>&#x0a;&#x0a;\subsubsection{</xsl:text>
292 <xsl:apply-templates />
293 <xsl:text>}</xsl:text>
294 </xsl:when>
295 <xsl:when test="name(..)='sect4'">
296 <xsl:text>&#x0a;&#x0a;\paragraph{</xsl:text>
297 <xsl:apply-templates />
298 <xsl:text>}</xsl:text>
299 </xsl:when>
300 <xsl:when test="name(..)='sect5'">
301 <xsl:text>&#x0a;&#x0a;\subparagraph{</xsl:text>
302 <xsl:apply-templates />
303 <xsl:text>}</xsl:text>
304 </xsl:when>
305 <xsl:when test="name(..)='appendix'">
306 <xsl:text>&#x0a;&#x0a;\chapter{</xsl:text>
307 <xsl:apply-templates />
308 <xsl:text>}</xsl:text>
309 </xsl:when>
310 <xsl:when test="name(..)='glossdiv'">
311 <xsl:text>&#x0a;&#x0a;\section*{</xsl:text>
312 <xsl:apply-templates />
313 <xsl:text>}</xsl:text>
314 </xsl:when>
315 </xsl:choose>
316 <xsl:variable name="refid" select="(@id) | (../@id)" />
317 <xsl:if test="$refid">
318 <xsl:value-of select="concat('&#x0a;\label{', $refid, '}')" />
319 </xsl:if>
320 <xsl:text>&#x0a;</xsl:text>
321 </xsl:template>
322
323 <xsl:template match="edition">
324 <xsl:choose>
325 <xsl:when test="name(..)='bookinfo'">
326 <xsl:text>\newcommand\docbooktitleedition{</xsl:text>
327 <xsl:apply-templates />
328 <xsl:text>}&#x0a;</xsl:text>
329 </xsl:when>
330 </xsl:choose>
331 </xsl:template>
332
333 <xsl:template match="corpauthor">
334 <xsl:choose>
335 <xsl:when test="name(..)='bookinfo'">
336 <xsl:text>\newcommand\docbookcorpauthor{</xsl:text>
337 <xsl:apply-templates />
338 <xsl:text>}&#x0a;</xsl:text>
339 </xsl:when>
340 </xsl:choose>
341 </xsl:template>
342
343 <xsl:template match="address">
344 <xsl:choose>
345 <xsl:when test="name(..)='bookinfo'">
346 <xsl:text>\newcommand\docbookbookinfoaddress{</xsl:text>
347 <xsl:apply-templates />
348 <xsl:text>}&#x0a;</xsl:text>
349 </xsl:when>
350 </xsl:choose>
351 </xsl:template>
352
353 <xsl:template match="year">
354 <xsl:choose>
355 <xsl:when test="name(..)='copyright'">
356 <xsl:text>\newcommand\docbookbookinfocopyrightyear{</xsl:text>
357 <xsl:apply-templates />
358 <xsl:text>}&#x0a;</xsl:text>
359 </xsl:when>
360 </xsl:choose>
361 </xsl:template>
362
363 <xsl:template match="holder">
364 <xsl:choose>
365 <xsl:when test="name(..)='copyright'">
366 <xsl:text>\newcommand\docbookbookinfocopyrightholder{</xsl:text>
367 <xsl:apply-templates />
368 <xsl:text>}&#x0a;</xsl:text>
369 </xsl:when>
370 </xsl:choose>
371 </xsl:template>
372
373 <xsl:template match="glossary">
374 <xsl:text>&#x0a;&#x0a;\backmatter&#x0a;\chapter{Glossary}&#x0a;</xsl:text>
375 <xsl:apply-templates />
376 </xsl:template>
377
378 <xsl:template match="para">
379 <xsl:if test="not(name(..)='footnote' or name(..)='note' or name(..)='warning')">
380 <xsl:text>&#x0a;&#x0a;</xsl:text>
381 </xsl:if>
382 <xsl:apply-templates />
383 </xsl:template>
384
385 <xsl:template match="note">
386 <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, ':} ')" />
387 <xsl:apply-templates />
388 <xsl:text>\end{minipage}}\end{center}&#x0a;&#x0a;\vspace{.2cm}&#x0a;&#x0a;</xsl:text>
389 </xsl:template>
390
391 <xsl:template match="warning">
392 <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, ':} ')" />
393 <xsl:apply-templates />
394 <xsl:text>\end{minipage}}\end{center}&#x0a;&#x0a;\vspace{.2cm}&#x0a;&#x0a;</xsl:text>
395 </xsl:template>
396
397 <xsl:template match="screen">
398 <xsl:text>&#x0a;&#x0a;\begin{Verbatim}[fontsize=\footnotesize]&#x0a;</xsl:text>
399 <xsl:apply-templates />
400 <xsl:text>&#x0a;\end{Verbatim}&#x0a;</xsl:text>
401 </xsl:template>
402
403 <xsl:template match="programlisting">
404 <xsl:text>&#x0a;&#x0a;{\small\begin{alltt}&#x0a;</xsl:text>
405 <xsl:apply-templates />
406 <xsl:text>&#x0a;\end{alltt}}&#x0a;</xsl:text>
407 </xsl:template>
408
409 <xsl:template match="footnote">
410 <xsl:text>\footnote{</xsl:text>
411 <xsl:apply-templates />
412 <xsl:text>}</xsl:text>
413 </xsl:template>
414
415 <xsl:template match="tgroup">
416 <xsl:choose>
417 <xsl:when test="@style='verywide'">
418 <xsl:text>&#x0a;&#x0a;{\small\begin{center}&#x0a;\begin{tabulary}{1.1\textwidth}[]{|L|L|L|}&#x0a;\hline&#x0a;</xsl:text>
419 </xsl:when>
420 <xsl:otherwise>
421 <xsl:text>&#x0a;&#x0a;{\small\begin{center}&#x0a;\begin{tabulary}{.9\textwidth}[]{|L|L|L|}&#x0a;\hline&#x0a;</xsl:text>
422 </xsl:otherwise>
423 </xsl:choose>
424 <xsl:apply-templates />
425 <xsl:text>&#x0a;\end{tabulary}&#x0a;\end{center}}&#x0a;</xsl:text>
426 </xsl:template>
427
428 <xsl:template match="row">
429 <xsl:apply-templates />
430 <xsl:text>&#x0a;\\ \hline&#x0a;</xsl:text>
431 </xsl:template>
432
433 <xsl:template match="entry">
434 <xsl:if test="not(position()=1)">
435 <xsl:text> &amp; </xsl:text>
436 </xsl:if>
437 <xsl:apply-templates />
438 </xsl:template>
439
440 <xsl:template match="itemizedlist">
441 <xsl:text>&#x0a;&#x0a;\begin{itemize}&#x0a;</xsl:text>
442 <xsl:apply-templates />
443 <xsl:text>&#x0a;\end{itemize}&#x0a;</xsl:text>
444 </xsl:template>
445
446 <xsl:template match="orderedlist">
447 <xsl:text>&#x0a;&#x0a;\begin{enumerate}&#x0a;</xsl:text>
448 <xsl:apply-templates />
449 <xsl:text>&#x0a;\end{enumerate}&#x0a;</xsl:text>
450 </xsl:template>
451
452 <xsl:template match="listitem">
453 <xsl:text>&#x0a;&#x0a;\item </xsl:text>
454 <xsl:apply-templates />
455 <xsl:text>&#x0a;</xsl:text>
456 </xsl:template>
457
458 <xsl:template match="glossterm">
459 <xsl:variable name="refid" select="(@id)" />
460 <xsl:if test="$refid">
461 <xsl:value-of select="concat('&#x0a;\label{', $refid, '}')" />
462 </xsl:if>
463 <xsl:text>&#x0a;&#x0a;\item[</xsl:text>
464 <xsl:apply-templates />
465 <xsl:text>]</xsl:text>
466 </xsl:template>
467
468 <xsl:template match="glosslist | glossdiv">
469 <xsl:text>&#x0a;&#x0a;\begin{description}&#x0a;</xsl:text>
470 <xsl:apply-templates />
471 <xsl:text>&#x0a;\end{description}&#x0a;</xsl:text>
472 </xsl:template>
473
474 <xsl:template match="superscript">
475 <xsl:variable name="contents">
476 <xsl:apply-templates />
477 </xsl:variable>
478 <xsl:value-of select="concat('\texorpdfstring{\textsuperscript{', $contents, '}}{', $contents, '}')" />
479 </xsl:template>
480
481 <xsl:template match="emphasis">
482 <xsl:choose>
483 <xsl:when test="@role='bold'">
484 <xsl:text>\textbf{</xsl:text>
485 </xsl:when>
486 <xsl:otherwise>
487 <xsl:text>\textit{</xsl:text>
488 </xsl:otherwise>
489 </xsl:choose>
490 <xsl:apply-templates />
491 <xsl:text>}</xsl:text>
492 </xsl:template>
493
494 <xsl:template match="computeroutput | code">
495 <xsl:text>\texttt{</xsl:text>
496 <xsl:apply-templates />
497 <xsl:text>}</xsl:text>
498 </xsl:template>
499
500 <xsl:template match="ulink">
501 <xsl:text>\url{</xsl:text>
502 <xsl:apply-templates />
503 <xsl:text>}</xsl:text>
504 </xsl:template>
505
506 <xsl:template match="xref">
507 <xsl:choose>
508 <xsl:when test="@xreflabel">
509 <xsl:value-of select="concat('\hyperref[', @linkend, ']{\mbox{', @xreflabel, '}}')" />
510 </xsl:when>
511 <xsl:when test="@apiref='yes'">
512 <xsl:value-of select="concat('\hyperref[', @linkend, ']{\mbox{')" />
513 <xsl:apply-templates />
514 <xsl:value-of select="'}}'" />
515 </xsl:when>
516 <xsl:otherwise>
517 <xsl:value-of select="concat($g_nlsChapter, ' \ref{', @linkend, '}, \textit{\nameref{', @linkend, '}}, ', $g_nlsPage, ' \pageref{', @linkend, '}')" />
518 </xsl:otherwise>
519 </xsl:choose>
520 </xsl:template>
521
522 <!-- for some reason, DocBook insists of having image data nested this way always:
523 mediaobject -> imageobject -> imagedata
524 but only imagedata is interesting -->
525 <xsl:template match="imagedata">
526 <xsl:if test="@align='center'">
527 <xsl:text>\begin{center}</xsl:text>
528 </xsl:if>
529 <xsl:value-of select="concat('&#x0a;\includegraphics[width=', @width, ']{', @fileref, '}&#x0a;')" />
530 <xsl:apply-templates />
531 <xsl:if test="@align='center'">
532 <xsl:text>\end{center}</xsl:text>
533 </xsl:if>
534 </xsl:template>
535
536 <xsl:template match="//text()">
537 <xsl:variable name="subst1">
538 <xsl:call-template name="str:subst">
539 <xsl:with-param name="text" select="." />
540 <xsl:with-param name="replace" select="'\'" />
541 <xsl:with-param name="with" select="'\textbackslash{}'" />
542 <xsl:with-param name="disable-output-escaping" select="no" />
543 </xsl:call-template>
544 </xsl:variable>
545 <xsl:choose>
546 <xsl:when test="(name(..)='screen') or (name(../..)='screen')">
547 <xsl:value-of select="." />
548 </xsl:when>
549 <xsl:when test="(name(..)='computeroutput') or (name(../..)='computeroutput') or (name(..)='code') or (name(../..)='code')">
550 <xsl:variable name="subst2">
551 <xsl:call-template name="str:subst">
552 <xsl:with-param name="text" select="$subst1" />
553 <xsl:with-param name="replace" select="'--'" />
554 <xsl:with-param name="with" select="'-{}-'" />
555 <xsl:with-param name="disable-output-escaping" select="no" />
556 </xsl:call-template>
557 </xsl:variable>
558 <xsl:variable name="subst3">
559 <xsl:call-template name="str:subst">
560 <xsl:with-param name="text" select="$subst2" />
561 <xsl:with-param name="replace" select="'_'" />
562 <xsl:with-param name="with" select="'\_'" />
563 <xsl:with-param name="disable-output-escaping" select="no" />
564 </xsl:call-template>
565 </xsl:variable>
566 <xsl:variable name="subst4">
567 <xsl:call-template name="str:subst">
568 <xsl:with-param name="text" select="$subst3" />
569 <xsl:with-param name="replace" select="'$'" />
570 <xsl:with-param name="with" select="'\$'" />
571 <xsl:with-param name="disable-output-escaping" select="no" />
572 </xsl:call-template>
573 </xsl:variable>
574 <xsl:variable name="subst5">
575 <xsl:call-template name="str:subst">
576 <xsl:with-param name="text" select="$subst4" />
577 <xsl:with-param name="replace" select="'%'" />
578 <xsl:with-param name="with" select="'\%'" />
579 <xsl:with-param name="disable-output-escaping" select="no" />
580 </xsl:call-template>
581 </xsl:variable>
582 <xsl:variable name="subst6">
583 <xsl:call-template name="str:subst">
584 <xsl:with-param name="text" select="$subst5" />
585 <xsl:with-param name="replace" select="'#'" />
586 <xsl:with-param name="with" select="'\#'" />
587 <xsl:with-param name="disable-output-escaping" select="no" />
588 </xsl:call-template>
589 </xsl:variable>
590 <xsl:variable name="subst7">
591 <xsl:call-template name="str:subst">
592 <xsl:with-param name="text" select="$subst6" />
593 <xsl:with-param name="replace" select="'~'" />
594 <xsl:with-param name="with" select="'\textasciitilde '" />
595 <xsl:with-param name="disable-output-escaping" select="no" />
596 </xsl:call-template>
597 </xsl:variable>
598 <xsl:variable name="subst8">
599 <xsl:call-template name="str:subst">
600 <xsl:with-param name="text" select="$subst7" />
601 <xsl:with-param name="replace" select="'&amp;'" />
602 <xsl:with-param name="with" select="'\&amp;'" />
603 <xsl:with-param name="disable-output-escaping" select="no" />
604 </xsl:call-template>
605 </xsl:variable>
606 <xsl:value-of select="$subst8" />
607 </xsl:when>
608 <xsl:when test="(name(..)='address') or (name(../..)='address')">
609 <xsl:variable name="subst2">
610 <xsl:call-template name="str:subst">
611 <xsl:with-param name="text" select="$subst1" />
612 <xsl:with-param name="replace" select="'&#x0a;'" />
613 <xsl:with-param name="with" select="' \\'" />
614 <xsl:with-param name="disable-output-escaping" select="no" />
615 </xsl:call-template>
616 </xsl:variable>
617 <xsl:value-of select="$subst2" />
618 </xsl:when>
619 <xsl:otherwise>
620 <xsl:variable name="subst2">
621 <xsl:call-template name="str:subst">
622 <xsl:with-param name="text" select="$subst1" />
623 <xsl:with-param name="replace" select="'_'" />
624 <xsl:with-param name="with" select="'\_'" />
625 <xsl:with-param name="disable-output-escaping" select="no" />
626 </xsl:call-template>
627 </xsl:variable>
628 <xsl:variable name="subst3">
629 <xsl:call-template name="str:subst">
630 <xsl:with-param name="text" select="$subst2" />
631 <xsl:with-param name="replace" select="'$'" />
632 <xsl:with-param name="with" select="'\$'" />
633 <xsl:with-param name="disable-output-escaping" select="no" />
634 </xsl:call-template>
635 </xsl:variable>
636 <xsl:variable name="subst4">
637 <xsl:call-template name="str:subst">
638 <xsl:with-param name="text" select="$subst3" />
639 <xsl:with-param name="replace" select="'%'" />
640 <xsl:with-param name="with" select="'\%'" />
641 <xsl:with-param name="disable-output-escaping" select="no" />
642 </xsl:call-template>
643 </xsl:variable>
644 <xsl:variable name="subst5">
645 <xsl:call-template name="str:subst">
646 <xsl:with-param name="text" select="$subst4" />
647 <xsl:with-param name="replace" select="'#'" />
648 <xsl:with-param name="with" select="'\#'" />
649 <xsl:with-param name="disable-output-escaping" select="no" />
650 </xsl:call-template>
651 </xsl:variable>
652 <xsl:variable name="subst6">
653 <xsl:call-template name="str:subst">
654 <xsl:with-param name="text" select="$subst5" />
655 <xsl:with-param name="replace" select="'µ'" />
656 <xsl:with-param name="with" select="'$\mu$'" />
657 <xsl:with-param name="disable-output-escaping" select="no" />
658 </xsl:call-template>
659 </xsl:variable>
660 <xsl:variable name="subst7">
661 <xsl:call-template name="str:subst">
662 <xsl:with-param name="text" select="$subst6" />
663 <xsl:with-param name="replace" select="'®'" />
664 <xsl:with-param name="with" select="'\texorpdfstring{\textregistered}{}'" />
665 <xsl:with-param name="disable-output-escaping" select="no" />
666 </xsl:call-template>
667 </xsl:variable>
668 <xsl:variable name="quote">"</xsl:variable>
669 <!-- preparation for pretty quotes: replace all double quotes _outside_ screen
670 sections with "\QUOTE{}" strings, which the makefile will then replace
671 with pretty quotes by invoking sed a few times. Unfortunately there are
672 no regular expressions in XSLT so there's no other way. -->
673 <xsl:variable name="subst8">
674 <xsl:call-template name="str:subst">
675 <xsl:with-param name="text" select="$subst7" />
676 <xsl:with-param name="replace" select="$quote" />
677 <xsl:with-param name="with" select="'\QUOTE{}'" />
678 <xsl:with-param name="disable-output-escaping" select="no" />
679 </xsl:call-template>
680 </xsl:variable>
681 <xsl:variable name="subst9">
682 <xsl:call-template name="str:subst">
683 <xsl:with-param name="text" select="$subst8" />
684 <xsl:with-param name="replace" select="'~'" />
685 <xsl:with-param name="with" select="'\textasciitilde '" />
686 <xsl:with-param name="disable-output-escaping" select="no" />
687 </xsl:call-template>
688 </xsl:variable>
689 <xsl:variable name="subst10">
690 <xsl:call-template name="str:subst">
691 <xsl:with-param name="text" select="$subst9" />
692 <xsl:with-param name="replace" select="'&amp;'" />
693 <xsl:with-param name="with" select="'\&amp;'" />
694 <xsl:with-param name="disable-output-escaping" select="no" />
695 </xsl:call-template>
696 </xsl:variable>
697 <xsl:value-of select="$subst10" />
698 </xsl:otherwise>
699 </xsl:choose>
700 </xsl:template>
701</xsl:stylesheet>
702
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