Rocco Rutte:
[apps/madmutt.git] / doc / xslt / xhtml / admon.xsl
1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" 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://nwalsh.com/docbook/xsl/ for copyright
12      and other information.
13
14      ******************************************************************** -->
15
16 <xsl:template match="*" mode="admon.graphic.width">
17   <xsl:param name="node" select="."/>
18   <xsl:text>25</xsl:text>
19 </xsl:template>
20
21 <xsl:template match="note|important|warning|caution|tip">
22   <xsl:choose>
23     <xsl:when test="$admon.graphics != 0">
24       <xsl:call-template name="graphical.admonition"/>
25     </xsl:when>
26     <xsl:otherwise>
27       <xsl:call-template name="nongraphical.admonition"/>
28     </xsl:otherwise>
29   </xsl:choose>
30 </xsl:template>
31
32 <xsl:template name="admon.graphic">
33   <xsl:param name="node" select="."/>
34   <xsl:value-of select="$admon.graphics.path"/>
35   <xsl:choose>
36     <xsl:when test="local-name($node)='note'">note</xsl:when>
37     <xsl:when test="local-name($node)='warning'">warning</xsl:when>
38     <xsl:when test="local-name($node)='caution'">caution</xsl:when>
39     <xsl:when test="local-name($node)='tip'">tip</xsl:when>
40     <xsl:when test="local-name($node)='important'">important</xsl:when>
41     <xsl:otherwise>note</xsl:otherwise>
42   </xsl:choose>
43   <xsl:value-of select="$admon.graphics.extension"/>
44 </xsl:template>
45
46 <xsl:template name="graphical.admonition">
47   <xsl:variable name="admon.type">
48     <xsl:choose>
49       <xsl:when test="local-name(.)='note'">Note</xsl:when>
50       <xsl:when test="local-name(.)='warning'">Warning</xsl:when>
51       <xsl:when test="local-name(.)='caution'">Caution</xsl:when>
52       <xsl:when test="local-name(.)='tip'">Tip</xsl:when>
53       <xsl:when test="local-name(.)='important'">Important</xsl:when>
54       <xsl:otherwise>Note</xsl:otherwise>
55     </xsl:choose>
56   </xsl:variable>
57
58   <xsl:variable name="alt">
59     <xsl:call-template name="gentext">
60       <xsl:with-param name="key" select="$admon.type"/>
61     </xsl:call-template>
62   </xsl:variable>
63
64   <div class="{name(.)}">
65     <xsl:if test="$admon.style != ''">
66       <xsl:attribute name="style">
67         <xsl:value-of select="$admon.style"/>
68       </xsl:attribute>
69     </xsl:if>
70
71     <table border="0">
72       <xsl:attribute name="summary">
73         <xsl:value-of select="$admon.type"/>
74         <xsl:if test="title">
75           <xsl:text>: </xsl:text>
76           <xsl:value-of select="title"/>
77         </xsl:if>
78       </xsl:attribute>
79       <tr>
80         <td rowspan="2" align="center" valign="top">
81           <xsl:attribute name="width">
82             <xsl:apply-templates select="." mode="admon.graphic.width"/>
83           </xsl:attribute>
84           <img alt="[{$alt}]">
85             <xsl:attribute name="src">
86               <xsl:call-template name="admon.graphic"/>
87             </xsl:attribute>
88           </img>
89         </td>
90         <th align="left">
91           <xsl:call-template name="anchor"/>
92           <xsl:if test="$admon.textlabel != 0 or title">
93             <xsl:apply-templates select="." mode="object.title.markup"/>
94           </xsl:if>
95         </th>
96       </tr>
97       <tr>
98         <td align="left" valign="top">
99           <xsl:apply-templates/>
100         </td>
101       </tr>
102     </table>
103   </div>
104 </xsl:template>
105
106 <xsl:template name="nongraphical.admonition">
107   <div class="{name(.)}">
108     <xsl:if test="$admon.style">
109       <xsl:attribute name="style">
110         <xsl:value-of select="$admon.style"/>
111       </xsl:attribute>
112     </xsl:if>
113
114     <h3 class="title">
115       <xsl:call-template name="anchor"/>
116       <xsl:if test="$admon.textlabel != 0 or title">
117         <xsl:apply-templates select="." mode="object.title.markup"/>
118       </xsl:if>
119     </h3>
120
121     <xsl:apply-templates/>
122   </div>
123 </xsl:template>
124
125 <xsl:template match="note/title"/>
126 <xsl:template match="important/title"/>
127 <xsl:template match="warning/title"/>
128 <xsl:template match="caution/title"/>
129 <xsl:template match="tip/title"/>
130
131 </xsl:stylesheet>