2 <xsl:stylesheet exclude-result-prefixes="d"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:d="http://docbook.org/ns/docbook"
5 xmlns:fo="http://www.w3.org/1999/XSL/Format"
8 <!-- ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://cdn.docbook.org/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <xsl:template match="d:note|d:important|d:warning|d:caution|d:tip">
18 <xsl:when test="$admon.graphics != 0">
19 <xsl:call-template name="graphical.admonition"/>
22 <xsl:call-template name="nongraphical.admonition"/>
27 <xsl:template match="*" mode="admon.graphic.width">
28 <xsl:param name="node" select="."/>
29 <xsl:text>36pt</xsl:text>
32 <xsl:template name="admon.graphic">
33 <xsl:param name="node" select="."/>
35 <xsl:variable name="filename">
36 <xsl:value-of select="$admon.graphics.path"/>
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>
45 <xsl:value-of select="$admon.graphics.extension"/>
49 <xsl:when test="$fop.extensions != 0
50 or $arbortext.extensions != 0">
51 <xsl:value-of select="$filename"/>
54 <xsl:text>url(</xsl:text>
55 <xsl:value-of select="$filename"/>
56 <xsl:text>)</xsl:text>
61 <xsl:template name="graphical.admonition">
62 <xsl:variable name="id">
63 <xsl:call-template name="object.id"/>
65 <xsl:variable name="graphic.width">
66 <xsl:apply-templates select="." mode="admon.graphic.width"/>
70 xsl:use-attribute-sets="graphical.admonition.properties">
71 <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
72 provisional-label-separation="18pt">
74 <fo:list-item-label end-indent="label-end()">
76 <fo:external-graphic width="auto" height="auto"
77 content-width="{$graphic.width}" >
78 <xsl:attribute name="src">
79 <xsl:call-template name="admon.graphic"/>
81 </fo:external-graphic>
84 <fo:list-item-body start-indent="body-start()">
85 <xsl:if test="$admon.textlabel != 0 or d:title or d:info/d:title">
86 <fo:block xsl:use-attribute-sets="admonition.title.properties">
87 <xsl:apply-templates select="." mode="object.title.markup">
88 <xsl:with-param name="allow-anchors" select="1"/>
89 </xsl:apply-templates>
92 <fo:block xsl:use-attribute-sets="admonition.properties">
93 <xsl:apply-templates/>
101 <xsl:template name="nongraphical.admonition">
102 <xsl:variable name="id">
103 <xsl:call-template name="object.id"/>
107 xsl:use-attribute-sets="nongraphical.admonition.properties">
108 <xsl:if test="$admon.textlabel != 0 or d:title or d:info/d:title">
109 <fo:block keep-with-next.within-column='always'
110 xsl:use-attribute-sets="admonition.title.properties">
111 <xsl:apply-templates select="." mode="object.title.markup">
112 <xsl:with-param name="allow-anchors" select="1"/>
113 </xsl:apply-templates>
117 <fo:block xsl:use-attribute-sets="admonition.properties">
118 <xsl:apply-templates/>
123 <xsl:template match="d:note/d:title"></xsl:template>
124 <xsl:template match="d:important/d:title"></xsl:template>
125 <xsl:template match="d:warning/d:title"></xsl:template>
126 <xsl:template match="d:caution/d:title"></xsl:template>
127 <xsl:template match="d:tip/d:title"></xsl:template>