source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/fo-rtf.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: 5.1 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:exsl="http://exslt.org/common"
5 xmlns:set="http://exslt.org/sets"
6 exclude-result-prefixes="exsl set"
7 version="1.0">
8
9<!-- ********************************************************************
10 $Id: fo-rtf.xsl 6910 2007-06-28 23:23:30Z xmldoc $
11 ********************************************************************
12
13 This file is part of the DocBook XSL Stylesheet distribution.
14 See ../README or http://docbook.sf.net/ for copyright
15 copyright and other information.
16
17 ******************************************************************** -->
18
19<!-- This module contains templates that match against FO nodes. It is used
20 to post-process result tree fragments for some sorts of cleanup.
21 These templates can only ever be fired by a processor that supports
22 exslt:node-set(). -->
23
24<!-- ==================================================================== -->
25
26<!-- insert.fo.fnum mode templates insert a particular RTF at the beginning
27 of the first paragraph in the primary RTF. In fact, they are inserting
28 a footnote-number, so we tinker a few other things too, like spacing and
29 font-sizes. -->
30
31<xsl:template match="/" mode="insert.fo.fnum">
32 <xsl:param name="mark" select="'?'"/>
33 <xsl:apply-templates mode="insert.fo.fnum">
34 <xsl:with-param name="mark" select="$mark"/>
35 </xsl:apply-templates>
36</xsl:template>
37
38<xsl:template match="*" mode="insert.fo.fnum">
39 <xsl:param name="mark" select="'?'"/>
40 <xsl:copy>
41 <xsl:copy-of select="@*"/>
42 <xsl:apply-templates mode="insert.fo.fnum">
43 <xsl:with-param name="mark" select="$mark"/>
44 </xsl:apply-templates>
45 </xsl:copy>
46</xsl:template>
47
48<xsl:template match="fo:block" mode="insert.fo.fnum">
49 <xsl:param name="mark" select="'?'"/>
50 <xsl:copy>
51 <xsl:for-each select="@*">
52 <xsl:choose>
53 <xsl:when test="starts-with(name(.), 'space-before')"/>
54 <xsl:when test="starts-with(name(.), 'space-after')"/>
55 <xsl:when test="starts-with(name(.), 'font-size')"/>
56 <xsl:otherwise>
57 <xsl:copy-of select="."/>
58 </xsl:otherwise>
59 </xsl:choose>
60 </xsl:for-each>
61 <xsl:if test="not(preceding::fo:block)">
62 <xsl:copy-of select="$mark"/>
63 </xsl:if>
64 <xsl:apply-templates mode="insert.fo.fnum">
65 <xsl:with-param name="mark" select="$mark"/>
66 </xsl:apply-templates>
67 </xsl:copy>
68</xsl:template>
69
70<xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.fnum">
71 <xsl:param name="mark" select="'?'"/>
72 <xsl:copy/>
73</xsl:template>
74
75<!-- ==================================================================== -->
76
77<!-- insert.fo.block mode templates insert a particular RTF at the beginning
78 of the first paragraph in the primary RTF. -->
79
80<xsl:template match="/" mode="insert.fo.block">
81 <xsl:param name="mark" select="'?'"/>
82 <xsl:apply-templates mode="insert.fo.block">
83 <xsl:with-param name="mark" select="$mark"/>
84 </xsl:apply-templates>
85</xsl:template>
86
87<xsl:template match="*" mode="insert.fo.block">
88 <xsl:param name="mark" select="'?'"/>
89 <xsl:copy>
90 <xsl:copy-of select="@*"/>
91 <xsl:apply-templates mode="insert.fo.block">
92 <xsl:with-param name="mark" select="$mark"/>
93 </xsl:apply-templates>
94 </xsl:copy>
95</xsl:template>
96
97<xsl:template match="fo:block" mode="insert.fo.block">
98 <xsl:param name="mark" select="'?'"/>
99 <xsl:copy>
100 <xsl:copy-of select="@*"/>
101 <xsl:if test="not(preceding::fo:block)">
102 <xsl:copy-of select="$mark"/>
103 </xsl:if>
104 <xsl:apply-templates mode="insert.fo.block">
105 <xsl:with-param name="mark" select="$mark"/>
106 </xsl:apply-templates>
107 </xsl:copy>
108</xsl:template>
109
110<xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.block">
111 <xsl:param name="mark" select="'?'"/>
112 <xsl:copy/>
113</xsl:template>
114
115<!-- ==================================================================== -->
116
117<!-- insert.fo.text mode templates insert a particular RTF at the beginning
118 of the first text-node in the primary RTF. -->
119
120<xsl:template match="/" mode="insert.fo.text">
121 <xsl:param name="mark" select="'?'"/>
122 <xsl:apply-templates mode="insert.fo.text">
123 <xsl:with-param name="mark" select="$mark"/>
124 </xsl:apply-templates>
125</xsl:template>
126
127<xsl:template match="*" mode="insert.fo.text">
128 <xsl:param name="mark" select="'?'"/>
129 <xsl:copy>
130 <xsl:copy-of select="@*"/>
131 <xsl:apply-templates mode="insert.fo.text">
132 <xsl:with-param name="mark" select="$mark"/>
133 </xsl:apply-templates>
134 </xsl:copy>
135</xsl:template>
136
137<xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.text">
138 <xsl:param name="mark" select="'?'"/>
139
140 <xsl:if test="not(preceding::text())">
141 <xsl:copy-of select="$mark"/>
142 </xsl:if>
143
144 <xsl:copy/>
145</xsl:template>
146
147<xsl:template match="processing-instruction()|comment()" mode="insert.fo.text">
148 <xsl:param name="mark" select="'?'"/>
149 <xsl:copy/>
150</xsl:template>
151
152<!-- ==================================================================== -->
153
154</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.