Debian Codegraph @

docbook-xsl-ns/html/admon.xsl

raw symbols SCIP
1 <?xml version='1.0'?>
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 version='1.0'>
6
7 <!-- ********************************************************************
8
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://cdn.docbook.org/release/xsl/current/ for
11 copyright and other information.
12
13 ******************************************************************** -->
14
15 <xsl:template match="*" mode="admon.graphic.width">
16 <xsl:param name="node" select="."/>
17 <xsl:text>25</xsl:text>
18 </xsl:template>
19
20 <xsl:template match="d:note|d:important|d:warning|d:caution|d:tip">
21 <xsl:choose>
22 <xsl:when test="$admon.graphics != 0">
23 <xsl:call-template name="graphical.admonition"/>
24 </xsl:when>
25 <xsl:otherwise>
26 <xsl:call-template name="nongraphical.admonition"/>
27 </xsl:otherwise>
28 </xsl:choose>
29 </xsl:template>
30
31 <xsl:template name="admon.graphic">
32 <xsl:param name="node" select="."/>
33 <xsl:value-of select="$admon.graphics.path"/>
34 <xsl:choose>
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>
41 </xsl:choose>
42 <xsl:value-of select="$admon.graphics.extension"/>
43 </xsl:template>
44
45 <xsl:template name="graphical.admonition">
46 <xsl:variable name="admon.type">
47 <xsl:choose>
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>
54 </xsl:choose>
55 </xsl:variable>
56
57 <xsl:variable name="alt">
58 <xsl:call-template name="gentext">
59 <xsl:with-param name="key" select="$admon.type"/>
60 </xsl:call-template>
61 </xsl:variable>
62
63 <div>
64 <xsl:call-template name="common.html.attributes"/>
65 <xsl:call-template name="id.attribute"/>
66 <xsl:if test="$admon.style != '' and $make.clean.html = 0">
67 <xsl:attribute name="style">
68 <xsl:value-of select="$admon.style"/>
69 </xsl:attribute>
70 </xsl:if>
71
72 <table border="{$table.border.off}">
73 <!-- omit summary attribute in html5 output -->
74 <xsl:if test="$div.element != 'section'">
75 <xsl:attribute name="summary">
76 <xsl:value-of select="$admon.type"/>
77 <xsl:if test="d:title|d:info/d:title">
78 <xsl:text>: </xsl:text>
79 <xsl:value-of select="(d:title|d:info/d:title)[1]"/>
80 </xsl:if>
81 </xsl:attribute>
82 </xsl:if>
83 <tr>
84 <td rowspan="2" align="center" valign="top">
85 <xsl:attribute name="width">
86 <xsl:apply-templates select="." mode="admon.graphic.width"/>
87 </xsl:attribute>
88 <img alt="[{$alt}]">
89 <xsl:attribute name="src">
90 <xsl:call-template name="admon.graphic"/>
91 </xsl:attribute>
92 </img>
93 </td>
94 <th align="{$direction.align.start}">
95 <xsl:call-template name="anchor"/>
96 <xsl:if test="$admon.textlabel != 0 or d:title or d:info/d:title">
97 <xsl:apply-templates select="." mode="object.title.markup"/>
98 </xsl:if>
99 </th>
100 </tr>
101 <tr>
102 <td align="{$direction.align.start}" valign="top">
103 <xsl:apply-templates/>
104 </td>
105 </tr>
106 </table>
107 </div>
108 </xsl:template>
109
110 <xsl:template name="nongraphical.admonition">
111 <div>
112 <xsl:call-template name="common.html.attributes">
113 <xsl:with-param name="inherit" select="1"/>
114 </xsl:call-template>
115 <xsl:call-template name="id.attribute"/>
116 <xsl:if test="$admon.style != '' and $make.clean.html = 0">
117 <xsl:attribute name="style">
118 <xsl:value-of select="$admon.style"/>
119 </xsl:attribute>
120 </xsl:if>
121
122 <xsl:if test="$admon.textlabel != 0 or d:title or d:info/d:title">
123 <h3 class="title">
124 <xsl:call-template name="anchor"/>
125 <xsl:apply-templates select="." mode="object.title.markup"/>
126 </h3>
127 </xsl:if>
128
129 <xsl:apply-templates/>
130 </div>
131 </xsl:template>
132
133 <xsl:template match="d:note/d:title"></xsl:template>
134 <xsl:template match="d:important/d:title"></xsl:template>
135 <xsl:template match="d:warning/d:title"></xsl:template>
136 <xsl:template match="d:caution/d:title"></xsl:template>
137 <xsl:template match="d:tip/d:title"></xsl:template>
138
139 </xsl:stylesheet>