source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/profile-docbook.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 11.9 KB
Line 
1<?xml version="1.0" encoding="US-ASCII"?>
2<!--This file was created automatically by xsl2profile-->
3<!--from the DocBook XSL stylesheets.-->
4<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt" version="1.0">
5
6<!-- It is important to use indent="no" here, otherwise verbatim -->
7<!-- environments get broken by indented tags...at least when the -->
8<!-- callout extension is used...at least with some processors -->
9<xsl:output method="xml" indent="no"/>
10
11<!-- ********************************************************************
12 $Id: docbook.xsl 9647 2012-10-26 17:42:03Z bobstayton $
13 ********************************************************************
14
15 This file is part of the XSL DocBook Stylesheet distribution.
16 See ../README or http://docbook.sf.net/release/xsl/current/ for
17 copyright and other information.
18
19 ******************************************************************** -->
20
21<!-- ==================================================================== -->
22
23<xsl:include href="../VERSION.xsl"/>
24<xsl:include href="param.xsl"/>
25<xsl:include href="../lib/lib.xsl"/>
26<xsl:include href="../common/l10n.xsl"/>
27<xsl:include href="../common/common.xsl"/>
28<xsl:include href="../common/utility.xsl"/>
29<xsl:include href="../common/labels.xsl"/>
30<xsl:include href="../common/titles.xsl"/>
31<xsl:include href="../common/subtitles.xsl"/>
32<xsl:include href="../common/gentext.xsl"/>
33<xsl:include href="../common/olink.xsl"/>
34<xsl:include href="../common/targets.xsl"/>
35<xsl:include href="../common/pi.xsl"/>
36<xsl:include href="autotoc.xsl"/>
37<xsl:include href="autoidx.xsl"/>
38<xsl:include href="lists.xsl"/>
39<xsl:include href="callout.xsl"/>
40<xsl:include href="verbatim.xsl"/>
41<xsl:include href="graphics.xsl"/>
42<xsl:include href="xref.xsl"/>
43<xsl:include href="formal.xsl"/>
44<xsl:include href="table.xsl"/>
45<xsl:include href="htmltbl.xsl"/>
46<xsl:include href="sections.xsl"/>
47<xsl:include href="inline.xsl"/>
48<xsl:include href="footnote.xsl"/>
49<xsl:include href="fo.xsl"/>
50<xsl:include href="fo-rtf.xsl"/>
51<xsl:include href="info.xsl"/>
52<xsl:include href="keywords.xsl"/>
53<xsl:include href="division.xsl"/>
54<xsl:include href="index.xsl"/>
55<xsl:include href="toc.xsl"/>
56<xsl:include href="refentry.xsl"/>
57<xsl:include href="math.xsl"/>
58<xsl:include href="admon.xsl"/>
59<xsl:include href="component.xsl"/>
60<xsl:include href="biblio.xsl"/>
61<xsl:include href="biblio-iso690.xsl"/>
62<xsl:include href="glossary.xsl"/>
63<xsl:include href="block.xsl"/>
64<xsl:include href="task.xsl"/>
65<xsl:include href="qandaset.xsl"/>
66<xsl:include href="synop.xsl"/>
67<xsl:include href="titlepage.xsl"/>
68<xsl:include href="titlepage.templates.xsl"/>
69<xsl:include href="pagesetup.xsl"/>
70<xsl:include href="pi.xsl"/>
71<xsl:include href="spaces.xsl"/>
72<xsl:include href="ebnf.xsl"/>
73<xsl:include href="../html/chunker.xsl"/>
74<xsl:include href="annotations.xsl"/>
75<xsl:include href="../common/stripns.xsl"/>
76
77<xsl:include href="fop.xsl"/>
78<xsl:include href="fop1.xsl"/>
79<xsl:include href="xep.xsl"/>
80<xsl:include href="axf.xsl"/>
81<xsl:include href="ptc.xsl"/>
82
83<xsl:param name="stylesheet.result.type" select="'fo'"/>
84
85<!-- ==================================================================== -->
86
87<xsl:key name="id" match="*" use="@id|@xml:id"/>
88
89<!-- ==================================================================== -->
90
91<xsl:template match="*">
92 <xsl:message>
93 <xsl:text>Element </xsl:text>
94 <xsl:value-of select="local-name(.)"/>
95 <xsl:text> in namespace '</xsl:text>
96 <xsl:value-of select="namespace-uri(.)"/>
97 <xsl:text>' encountered</xsl:text>
98 <xsl:if test="parent::*">
99 <xsl:text> in </xsl:text>
100 <xsl:value-of select="name(parent::*)"/>
101 </xsl:if>
102 <xsl:text>, but no template matches.</xsl:text>
103 </xsl:message>
104
105 <fo:block color="red">
106 <xsl:text>&lt;</xsl:text>
107 <xsl:value-of select="name(.)"/>
108 <xsl:text>&gt;</xsl:text>
109 <xsl:apply-templates/>
110 <xsl:text>&lt;/</xsl:text>
111 <xsl:value-of select="name(.)"/>
112 <xsl:text>&gt;</xsl:text>
113 </fo:block>
114</xsl:template>
115
116<!-- Update this list if new root elements supported -->
117<xsl:variable name="root.elements" select="' appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex '"/>
118
119<xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Note: namesp. cut : stripped namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Note: namesp. cut : processing stripped document</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
120 <!-- * Get a title for current doc so that we let the user -->
121 <!-- * know what document we are processing at this point. -->
122 <xsl:variable name="doc.title">
123 <xsl:call-template name="get.doc.title"/>
124 </xsl:variable>
125 <xsl:choose>
126 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
127 toss the namespace and continue. Use the docbook5 namespaced
128 stylesheets for DocBook5 if you don't want to use this feature.-->
129 <xsl:when test="false()"/>
130 <!-- Can't process unless namespace removed -->
131 <xsl:when test="false()"/>
132 <xsl:otherwise>
133 <xsl:choose>
134 <xsl:when test="$rootid != ''">
135 <xsl:variable name="root.element" select="key('id', $rootid)"/>
136 <xsl:choose>
137 <xsl:when test="count($root.element) = 0">
138 <xsl:message terminate="yes">
139 <xsl:text>ID '</xsl:text>
140 <xsl:value-of select="$rootid"/>
141 <xsl:text>' not found in document.</xsl:text>
142 </xsl:message>
143 </xsl:when>
144 <xsl:when test="not(contains($root.elements, concat(' ', local-name($root.element), ' ')))">
145 <xsl:message terminate="yes">
146 <xsl:text>ERROR: Document root element ($rootid=</xsl:text>
147 <xsl:value-of select="$rootid"/>
148 <xsl:text>) for FO output </xsl:text>
149 <xsl:text>must be one of the following elements:</xsl:text>
150 <xsl:value-of select="$root.elements"/>
151 </xsl:message>
152 </xsl:when>
153 <!-- Otherwise proceed -->
154 <xsl:otherwise>
155 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
156 <xsl:apply-templates select="$root.element" mode="collect.targets"/>
157 </xsl:if>
158 <xsl:if test="$collect.xref.targets != 'only'">
159 <xsl:apply-templates select="$root.element" mode="process.root"/>
160 </xsl:if>
161 </xsl:otherwise>
162 </xsl:choose>
163 </xsl:when>
164 <!-- Otherwise process the document root element -->
165 <xsl:otherwise>
166 <xsl:variable name="document.element" select="*[1]"/>
167 <xsl:choose>
168 <xsl:when test="not(contains($root.elements, concat(' ', local-name($document.element), ' ')))">
169 <xsl:message terminate="yes">
170 <xsl:text>ERROR: Document root element for FO output </xsl:text>
171 <xsl:text>must be one of the following elements:</xsl:text>
172 <xsl:value-of select="$root.elements"/>
173 </xsl:message>
174 </xsl:when>
175 <!-- Otherwise proceed -->
176 <xsl:otherwise>
177 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
178 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
179 </xsl:if>
180 <xsl:if test="$collect.xref.targets != 'only'">
181 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
182 </xsl:if>
183 </xsl:otherwise>
184 </xsl:choose>
185 </xsl:otherwise>
186 </xsl:choose>
187 </xsl:otherwise>
188 </xsl:choose>
189</xsl:template>
190
191<xsl:template match="*" mode="process.root">
192 <xsl:variable name="document.element" select="self::*"/>
193
194 <xsl:call-template name="root.messages"/>
195
196 <xsl:variable name="title">
197 <xsl:choose>
198 <xsl:when test="$document.element/title[1]">
199 <xsl:value-of select="$document.element/title[1]"/>
200 </xsl:when>
201 <xsl:otherwise>[could not find document title]</xsl:otherwise>
202 </xsl:choose>
203 </xsl:variable>
204
205 <!-- Include all id values in XEP output -->
206 <xsl:if test="$xep.extensions != 0">
207 <xsl:processing-instruction name="xep-pdf-drop-unused-destinations">false</xsl:processing-instruction>
208 </xsl:if>
209
210 <fo:root xsl:use-attribute-sets="root.properties">
211 <xsl:attribute name="language">
212 <xsl:call-template name="l10n.language">
213 <xsl:with-param name="target" select="/*[1]"/>
214 </xsl:call-template>
215 </xsl:attribute>
216
217 <xsl:if test="$xep.extensions != 0">
218 <xsl:call-template name="xep-pis"/>
219 <xsl:call-template name="xep-document-information"/>
220 </xsl:if>
221 <xsl:if test="$axf.extensions != 0">
222 <xsl:call-template name="axf-document-information"/>
223 </xsl:if>
224
225 <xsl:call-template name="setup.pagemasters"/>
226
227 <xsl:if test="$fop.extensions != 0">
228 <xsl:apply-templates select="$document.element" mode="fop.outline"/>
229 </xsl:if>
230
231 <xsl:if test="$fop1.extensions != 0">
232 <xsl:call-template name="fop1-document-information"/>
233 <xsl:variable name="bookmarks">
234 <xsl:apply-templates select="$document.element" mode="fop1.outline"/>
235 </xsl:variable>
236 <xsl:if test="string($bookmarks) != ''">
237 <fo:bookmark-tree>
238 <xsl:copy-of select="$bookmarks"/>
239 </fo:bookmark-tree>
240 </xsl:if>
241 <xsl:apply-templates select="$document.element" mode="fop1.foxdest"/>
242 </xsl:if>
243
244 <xsl:if test="$xep.extensions != 0">
245 <xsl:variable name="bookmarks">
246 <xsl:apply-templates select="$document.element" mode="xep.outline"/>
247 </xsl:variable>
248 <xsl:if test="string($bookmarks) != ''">
249 <rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions">
250 <xsl:copy-of select="$bookmarks"/>
251 </rx:outline>
252 </xsl:if>
253 </xsl:if>
254
255 <xsl:if test="$arbortext.extensions != 0 and $ati.xsl11.bookmarks != 0">
256 <xsl:variable name="bookmarks">
257 <xsl:apply-templates select="$document.element" mode="ati.xsl11.bookmarks"/>
258 </xsl:variable>
259 <xsl:if test="string($bookmarks) != ''">
260 <fo:bookmark-tree>
261 <xsl:copy-of select="$bookmarks"/>
262 </fo:bookmark-tree>
263 </xsl:if>
264 </xsl:if>
265
266 <xsl:apply-templates select="$document.element"/>
267 </fo:root>
268</xsl:template>
269
270<xsl:template name="root.messages">
271 <!-- redefine this any way you'd like to output messages -->
272 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
273 <xsl:message>
274 <xsl:text>Making </xsl:text>
275 <xsl:value-of select="$page.orientation"/>
276 <xsl:text> pages on </xsl:text>
277 <xsl:value-of select="$paper.type"/>
278 <xsl:text> paper (</xsl:text>
279 <xsl:value-of select="$page.width"/>
280 <xsl:text>x</xsl:text>
281 <xsl:value-of select="$page.height"/>
282 <xsl:text>)</xsl:text>
283 </xsl:message>
284</xsl:template>
285
286<!-- ==================================================================== -->
287
288</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.