1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                version='1.0'>
4
5<!-- ********************************************************************
6     $Id$
7     ********************************************************************
8
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.
12
13     ******************************************************************** -->
14
15<xsl:template name="formal.object">
16  <div class="{name(.)}">
17    <xsl:call-template name="formal.object.heading">
18       <xsl:with-param name="title">
19         <xsl:apply-templates select="." mode="title.markup"/>
20       </xsl:with-param>
21    </xsl:call-template>
22    <xsl:apply-templates/>
23  </div>
24</xsl:template>
25
26<xsl:template name="formal.object.heading">
27  <p>
28    <a>
29      <xsl:attribute name="name">
30	<xsl:call-template name="object.id"/>
31      </xsl:attribute>
32    </a>
33    <b><xsl:apply-templates select="." mode="object.title.markup"/></b>
34  </p>
35</xsl:template>
36
37<xsl:template name="informal.object">
38  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
39
40  <div class="{name(.)}" id="{$id}">
41    <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
42    <a name="{$id}"/>
43    <xsl:apply-templates/>
44    <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
45  </div>
46</xsl:template>
47
48<xsl:template name="semiformal.object">
49  <xsl:choose>
50    <xsl:when test="title">
51      <xsl:call-template name="formal.object"/>
52    </xsl:when>
53    <xsl:otherwise>
54      <xsl:call-template name="informal.object"/>
55    </xsl:otherwise>
56  </xsl:choose>
57</xsl:template>
58
59<xsl:template match="figure|table|example">
60  <xsl:call-template name="formal.object"/>
61</xsl:template>
62
63<xsl:template match="equation">
64  <xsl:call-template name="semiformal.object"/>
65</xsl:template>
66
67<xsl:template match="figure/title"></xsl:template>
68<xsl:template match="table/title"></xsl:template>
69<xsl:template match="example/title"></xsl:template>
70<xsl:template match="equation/title"></xsl:template>
71
72<xsl:template match="informalfigure">
73  <xsl:call-template name="informal.object"/>
74</xsl:template>
75
76<xsl:template match="informalexample">
77  <xsl:call-template name="informal.object"/>
78</xsl:template>
79
80<xsl:template match="informaltable">
81  <xsl:call-template name="informal.object"/>
82</xsl:template>
83
84<xsl:template match="informalequation">
85  <xsl:call-template name="informal.object"/>
86</xsl:template>
87
88</xsl:stylesheet>
89