2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: admon.xsl,v 1.1 2007/03/10 05:15:13 scott Exp $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
11 and other information.
13 ******************************************************************** -->
15 <xsl:template match=
"*" mode=
"admon.graphic.width">
16 <xsl:param name=
"node" select=
"."/>
17 <xsl:text>25</xsl:text>
20 <xsl:template match=
"note|important|warning|caution|tip">
22 <xsl:when test=
"$admon.graphics != 0">
23 <xsl:call-template name=
"graphical.admonition"/>
26 <xsl:call-template name=
"nongraphical.admonition"/>
31 <xsl:template name=
"admon.graphic">
32 <xsl:param name=
"node" select=
"."/>
33 <xsl:value-of select=
"$admon.graphics.path"/>
35 <xsl:when test=
"local-name($node)='note'">note
</xsl:when>
36 <xsl:when test=
"local-name($node)='warning'">warning
</xsl:when>
37 <xsl:when test=
"local-name($node)='caution'">caution
</xsl:when>
38 <xsl:when test=
"local-name($node)='tip'">tip
</xsl:when>
39 <xsl:when test=
"local-name($node)='important'">important
</xsl:when>
40 <xsl:otherwise>note
</xsl:otherwise>
42 <xsl:value-of select=
"$admon.graphics.extension"/>
45 <xsl:template name=
"graphical.admonition">
46 <xsl:variable name=
"admon.type">
48 <xsl:when test=
"local-name(.)='note'">Note
</xsl:when>
49 <xsl:when test=
"local-name(.)='warning'">Warning
</xsl:when>
50 <xsl:when test=
"local-name(.)='caution'">Caution
</xsl:when>
51 <xsl:when test=
"local-name(.)='tip'">Tip
</xsl:when>
52 <xsl:when test=
"local-name(.)='important'">Important
</xsl:when>
53 <xsl:otherwise>Note
</xsl:otherwise>
57 <xsl:variable name=
"alt">
58 <xsl:call-template name=
"gentext">
59 <xsl:with-param name=
"key" select=
"$admon.type"/>
64 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
65 <xsl:if test=
"$admon.style != ''">
66 <xsl:attribute name=
"style">
67 <xsl:value-of select=
"$admon.style"/>
72 <xsl:attribute name=
"summary">
73 <xsl:value-of select=
"$admon.type"/>
74 <xsl:if test=
"title|info/title">
75 <xsl:text>:
</xsl:text>
76 <xsl:value-of select=
"(title|info/title)[1]"/>
80 <td rowspan=
"2" align=
"center" valign=
"top">
81 <xsl:attribute name=
"width">
82 <xsl:apply-templates select=
"." mode=
"admon.graphic.width"/>
85 <xsl:attribute name=
"src">
86 <xsl:call-template name=
"admon.graphic"/>
91 <xsl:call-template name=
"anchor"/>
92 <xsl:if test=
"$admon.textlabel != 0 or title or info/title">
93 <xsl:apply-templates select=
"." mode=
"object.title.markup"/>
98 <td align=
"left" valign=
"top">
99 <xsl:apply-templates/>
106 <xsl:template name=
"nongraphical.admonition">
108 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
109 <xsl:if test=
"$admon.style">
110 <xsl:attribute name=
"style">
111 <xsl:value-of select=
"$admon.style"/>
116 <xsl:call-template name=
"anchor"/>
117 <xsl:if test=
"$admon.textlabel != 0 or title or info/title">
118 <xsl:apply-templates select=
"." mode=
"object.title.markup"/>
122 <xsl:apply-templates/>
126 <xsl:template match=
"note/title"></xsl:template>
127 <xsl:template match=
"important/title"></xsl:template>
128 <xsl:template match=
"warning/title"></xsl:template>
129 <xsl:template match=
"caution/title"></xsl:template>
130 <xsl:template match=
"tip/title"></xsl:template>