~ubuntu-branches/ubuntu/trusty/yelp-xsl/trusty

« back to all changes in this revision

Viewing changes to xslt/docbook/html/db2html-qanda.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-07-09 10:02:21 UTC
  • mto: (11.1.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20110709100221-27hsncxrd63leyx4
Tags: upstream-3.1.2
ImportĀ upstreamĀ versionĀ 3.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
2
 
<!--
3
 
This program is free software; you can redistribute it and/or modify it under
4
 
the terms of the GNU Lesser General Public License as published by the Free
5
 
Software Foundation; either version 2 of the License, or (at your option) any
6
 
later version.
7
 
 
8
 
This program is distributed in the hope that it will be useful, but WITHOUT
9
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
 
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11
 
details.
12
 
 
13
 
You should have received a copy of the GNU Lesser General Public License
14
 
along with this program; see the file COPYING.LGPL.  If not, write to the
15
 
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16
 
02111-1307, USA.
17
 
-->
18
 
 
19
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
 
                xmlns:db="http://docbook.org/ns/docbook"
21
 
                xmlns="http://www.w3.org/1999/xhtml"
22
 
                version="1.0">
23
 
 
24
 
<!--!!==========================================================================
25
 
DocBook to HTML - Question and Answer Sets
26
 
:Requires: db-chunk db2html-division gettext
27
 
 
28
 
REMARK: Describe this module
29
 
-->
30
 
 
31
 
 
32
 
<!--**==========================================================================
33
 
db2html.qanda.css
34
 
Outputs CSS that controls the appearance of question and answer elements
35
 
 
36
 
REMARK: Describe this template
37
 
-->
38
 
<xsl:template name="db2html.qanda.css">
39
 
<xsl:text>
40
 
dt.question { margin-left: 0em; }
41
 
dt.question div.label { float: left; }
42
 
dd + dt.question { margin-top: 1em; }
43
 
dd.answer {
44
 
  margin-top: 1em;
45
 
  margin-left: 2em;
46
 
  margin-right: 1em;
47
 
}
48
 
dd.answer div.label { float: left; }
49
 
</xsl:text>
50
 
</xsl:template>
51
 
 
52
 
 
53
 
<!-- == Matched Templates == -->
54
 
 
55
 
<!-- = answer = -->
56
 
<xsl:template match="answer | db:answer">
57
 
  <dd class="answer">
58
 
    <xsl:choose>
59
 
      <xsl:when test="@lang or @xml:lang">
60
 
        <xsl:attribute name="dir">
61
 
          <xsl:call-template name="l10n.direction">
62
 
            <xsl:with-param name="lang" select="@lang | @xml:lang"/>
63
 
          </xsl:call-template>
64
 
        </xsl:attribute>
65
 
      </xsl:when>
66
 
      <xsl:when test="../@lang or ../@xml:lang">
67
 
        <xsl:attribute name="dir">
68
 
          <xsl:call-template name="l10n.direction">
69
 
            <xsl:with-param name="lang" select="../@lang | ../@xml:lang"/>
70
 
          </xsl:call-template>
71
 
        </xsl:attribute>
72
 
      </xsl:when>
73
 
    </xsl:choose>
74
 
    <xsl:apply-templates/>
75
 
  </dd>
76
 
</xsl:template>
77
 
 
78
 
<!-- = qandadiv = -->
79
 
<xsl:template match="qandadiv | db:qandadiv">
80
 
  <xsl:param name="depth_in_chunk">
81
 
    <xsl:call-template name="db.chunk.depth-in-chunk"/>
82
 
  </xsl:param>
83
 
  <xsl:param name="depth_of_chunk">
84
 
    <xsl:call-template name="db.chunk.depth-of-chunk"/>
85
 
  </xsl:param>
86
 
  <xsl:call-template name="db2html.division.div">
87
 
    <xsl:with-param name="info" select="blockinfo | db:info"/>
88
 
    <xsl:with-param name="entries" select="qandaentry | db:qandaentry"/>
89
 
    <xsl:with-param name="divisions" select="qandadiv | db:qandadiv"/>
90
 
    <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
91
 
    <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
92
 
    <xsl:with-param name="chunk_divisions" select="false()"/>
93
 
    <xsl:with-param name="chunk_info" select="false()"/>
94
 
    <xsl:with-param name="autotoc_divisions" select="false()"/>
95
 
  </xsl:call-template>
96
 
</xsl:template>
97
 
 
98
 
<!-- = qandaentry = -->
99
 
<xsl:template match="qandaentry | db:qandaentry">
100
 
  <xsl:apply-templates/>
101
 
</xsl:template>
102
 
 
103
 
<!-- = qandaset = -->
104
 
<xsl:template match="qandaset | db:qandaset">
105
 
  <xsl:param name="depth_in_chunk">
106
 
    <xsl:call-template name="db.chunk.depth-in-chunk"/>
107
 
  </xsl:param>
108
 
  <xsl:param name="depth_of_chunk">
109
 
    <xsl:call-template name="db.chunk.depth-of-chunk"/>
110
 
  </xsl:param>
111
 
  <xsl:call-template name="db2html.division.div">
112
 
    <xsl:with-param name="info" select="blockinfo | db:info"/>
113
 
    <xsl:with-param name="entries" select="qandaentry | db:qandaentry"/>
114
 
    <xsl:with-param name="divisions" select="qandadiv | db:qandadiv"/>
115
 
    <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
116
 
    <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
117
 
    <xsl:with-param name="chunk_divisions" select="false()"/>
118
 
    <xsl:with-param name="chunk_info" select="false()"/>
119
 
    <xsl:with-param name="autotoc_divisions" select="true()"/>
120
 
  </xsl:call-template>
121
 
</xsl:template>
122
 
 
123
 
<!-- = question = -->
124
 
<xsl:template match="question | db:question">
125
 
  <!-- FIXME: dt-first -->
126
 
  <dt class="question">
127
 
    <xsl:choose>
128
 
      <xsl:when test="@lang | @xml:lang">
129
 
        <xsl:attribute name="dir">
130
 
          <xsl:call-template name="l10n.direction">
131
 
            <xsl:with-param name="lang" select="@lang | @xml:lang"/>
132
 
          </xsl:call-template>
133
 
        </xsl:attribute>
134
 
      </xsl:when>
135
 
      <xsl:when test="../@lang or ../@xml:lang">
136
 
        <xsl:attribute name="dir">
137
 
          <xsl:call-template name="l10n.direction">
138
 
            <xsl:with-param name="lang" select="../@lang | ../@xml:lang"/>
139
 
          </xsl:call-template>
140
 
        </xsl:attribute>
141
 
      </xsl:when>
142
 
    </xsl:choose>
143
 
    <xsl:apply-templates/>
144
 
  </dt>
145
 
</xsl:template>
146
 
 
147
 
</xsl:stylesheet>