1<?xml version='1.0'?>
2<!-- vim: sw=2 sta et
3-->
4
5<!DOCTYPE xsl:stylesheet [
6<!ENTITY lsquo "&#x2018;">
7<!ENTITY rsquo "&#x2019;">
8<!ENTITY ldquo "&#x201C;">
9<!ENTITY rdquo "&#x201D;">
10]>
11
12<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
14                xmlns="http://docbook2x.sourceforge.net/xmlns/Texi-XML"
15                exclude-result-prefixes="doc"
16                version='1.0'
17                xml:lang="en">
18
19<!-- ********************************************************************
20     $Id: caption.xsl,v 1.13 2004/08/22 22:46:06 stevecheng Exp $
21     ********************************************************************
22
23     (C) 2000-2004 Steve Cheng <stevecheng@users.sourceforge.net>
24
25     This file is part of the docbook2X XSLT stylesheets for
26     converting DocBook to Texinfo.
27
28     See ../../COPYING for the copyright status of this software.
29
30     ******************************************************************** -->
31
32<doc:reference xmlns="">
33<title>Captions (really headings)</title>
34</doc:reference>
35
36<!-- ==================================================================== -->
37
38<doc:template name="make-caption" xmlns="">
39<refpurpose>Render as a &lsquo;caption&rsquo;</refpurpose>
40<refdescription>
41<para>
42This template renders content (usually titles in certain block objects)
43as a &lsquo;caption&rsquo;.  What this exactly means depends on the value
44of the <varname>captions-display-as-headings</varname> parameter.
45</para>
46</refdescription>
47<refparameter>
48<variablelist>
49<varlistentry>
50<term><parameter>content</parameter></term>
51<listitem><para>
52The result tree fragment to render.  If not specified, defaults to
53applying <function>for-title</function> mode to the
54<emphasis>context</emphasis> node.
55</para></listitem>
56</varlistentry>
57</variablelist>
58</refparameter>
59</doc:template>
60
61<xsl:template name="make-caption">
62  <xsl:param name="content">
63    <xsl:apply-templates select="." mode="for-title" />
64  </xsl:param>
65
66  <xsl:choose>
67    <xsl:when test="$captions-display-as-headings">
68      <xsl:call-template name="make-texinfo-section">
69        <xsl:with-param name="level">
70          <xsl:call-template name="get-texinfo-section-level">
71            <xsl:with-param name="heading-class" select="'chapheading'" />
72          </xsl:call-template>
73        </xsl:with-param>
74        <xsl:with-param name="title" select="$content" />
75      </xsl:call-template>
76    </xsl:when>
77
78    <xsl:otherwise>
79      <para>
80        <strong>
81          <xsl:copy-of select="$content" />
82        </strong>
83      </para>
84    </xsl:otherwise>
85  </xsl:choose>
86</xsl:template>
87
88<!-- ==================================================================== -->
89
90</xsl:stylesheet>
91