source: stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/admon.xsl@ aaab3da7

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since aaab3da7 was aaab3da7, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Updated DocBook-XSL code to version 1.73.2

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@7105 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 4.6 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 version='1.0'>
5
6<!-- ********************************************************************
7 $Id$
8 ********************************************************************
9
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
13
14 ******************************************************************** -->
15
16<xsl:template match="note|important|warning|caution|tip">
17 <xsl:choose>
18 <xsl:when test="$admon.graphics != 0">
19 <xsl:call-template name="graphical.admonition"/>
20 </xsl:when>
21 <xsl:otherwise>
22 <xsl:call-template name="nongraphical.admonition"/>
23 </xsl:otherwise>
24 </xsl:choose>
25</xsl:template>
26
27<xsl:template match="*" mode="admon.graphic.width">
28 <xsl:param name="node" select="."/>
29 <xsl:text>36pt</xsl:text>
30</xsl:template>
31
32<xsl:template name="admon.graphic">
33 <xsl:param name="node" select="."/>
34
35 <xsl:variable name="filename">
36 <xsl:value-of select="$admon.graphics.path"/>
37 <xsl:choose>
38 <xsl:when test="local-name($node)='note'">note</xsl:when>
39 <xsl:when test="local-name($node)='warning'">warning</xsl:when>
40 <xsl:when test="local-name($node)='caution'">caution</xsl:when>
41 <xsl:when test="local-name($node)='tip'">tip</xsl:when>
42 <xsl:when test="local-name($node)='important'">important</xsl:when>
43 <xsl:otherwise>note</xsl:otherwise>
44 </xsl:choose>
45 <xsl:value-of select="$admon.graphics.extension"/>
46 </xsl:variable>
47
48 <xsl:choose>
49 <xsl:when test="$passivetex.extensions != 0
50 or $fop.extensions != 0
51 or $arbortext.extensions != 0">
52 <xsl:value-of select="$filename"/>
53 </xsl:when>
54 <xsl:otherwise>
55 <xsl:text>url(</xsl:text>
56 <xsl:value-of select="$filename"/>
57 <xsl:text>)</xsl:text>
58 </xsl:otherwise>
59 </xsl:choose>
60</xsl:template>
61
62<xsl:template name="graphical.admonition">
63 <xsl:variable name="id">
64 <xsl:call-template name="object.id"/>
65 </xsl:variable>
66 <xsl:variable name="graphic.width">
67 <xsl:apply-templates select="." mode="admon.graphic.width"/>
68 </xsl:variable>
69
70 <fo:block id="{$id}"
71 xsl:use-attribute-sets="graphical.admonition.properties">
72 <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
73 provisional-label-separation="18pt">
74 <fo:list-item>
75 <fo:list-item-label end-indent="label-end()">
76 <fo:block>
77 <fo:external-graphic width="auto" height="auto"
78 content-width="{$graphic.width}" >
79 <xsl:attribute name="src">
80 <xsl:call-template name="admon.graphic"/>
81 </xsl:attribute>
82 </fo:external-graphic>
83 </fo:block>
84 </fo:list-item-label>
85 <fo:list-item-body start-indent="body-start()">
86 <xsl:if test="$admon.textlabel != 0 or title or info/title">
87 <fo:block xsl:use-attribute-sets="admonition.title.properties">
88 <xsl:apply-templates select="." mode="object.title.markup">
89 <xsl:with-param name="allow-anchors" select="1"/>
90 </xsl:apply-templates>
91 </fo:block>
92 </xsl:if>
93 <fo:block xsl:use-attribute-sets="admonition.properties">
94 <xsl:apply-templates/>
95 </fo:block>
96 </fo:list-item-body>
97 </fo:list-item>
98 </fo:list-block>
99 </fo:block>
100</xsl:template>
101
102<xsl:template name="nongraphical.admonition">
103 <xsl:variable name="id">
104 <xsl:call-template name="object.id"/>
105 </xsl:variable>
106
107 <fo:block id="{$id}"
108 xsl:use-attribute-sets="nongraphical.admonition.properties">
109 <xsl:if test="$admon.textlabel != 0 or title or info/title">
110 <fo:block keep-with-next.within-column='always'
111 xsl:use-attribute-sets="admonition.title.properties">
112 <xsl:apply-templates select="." mode="object.title.markup">
113 <xsl:with-param name="allow-anchors" select="1"/>
114 </xsl:apply-templates>
115 </fo:block>
116 </xsl:if>
117
118 <fo:block xsl:use-attribute-sets="admonition.properties">
119 <xsl:apply-templates/>
120 </fo:block>
121 </fo:block>
122</xsl:template>
123
124<xsl:template match="note/title"></xsl:template>
125<xsl:template match="important/title"></xsl:template>
126<xsl:template match="warning/title"></xsl:template>
127<xsl:template match="caution/title"></xsl:template>
128<xsl:template match="tip/title"></xsl:template>
129
130</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.