Debian Codegraph @

xslt/dita/html/dita2html-inline.xsl

raw
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, see <http://www.gnu.org/licenses/>.
15 -->
16 <!DOCTYPE xsl:stylesheet [
17 <!ENTITY % selectors SYSTEM "../common/dita-selectors.mod">
18 %selectors;
19 ]>
20
21 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22 xmlns:yelp="http://projects.gnome.org/yelp/"
23 xmlns="http://www.w3.org/1999/xhtml"
24 exclude-result-prefixes="yelp"
25 version="1.0">
26
27 <!--!!==========================================================================
28 DITA to HTML - Inlines
29
30 REMARK: Describe this module
31 -->
32
33
34 <xsl:template mode="dita.ref.content.mode" match="*">
35 <xsl:apply-templates mode="dita2html.topic.mode" select="."/>
36 </xsl:template>
37
38
39 <!--**==========================================================================
40 dita2html.span
41 Output an HTML `span` element.
42 @revision[version=3.8 date=2012-10-04 status=incomplete]
43
44 [xsl:params]
45 $node: The source element to output a `span` for.
46 $class: The value of the HTML `class` attribute.
47
48 FIXME
49 -->
50 <xsl:template name="dita2html.span">
51 <xsl:param name="node" select="."/>
52 <xsl:param name="class" select="local-name($node)"/>
53 <span>
54 <xsl:call-template name="dita.id">
55 <xsl:with-param name="node" select="$node"/>
56 </xsl:call-template>
57 <xsl:call-template name="html.lang.attrs">
58 <xsl:with-param name="node" select="$node"/>
59 </xsl:call-template>
60 <xsl:call-template name="html.class.attr">
61 <xsl:with-param name="node" select="$node"/>
62 <xsl:with-param name="class" select="$class"/>
63 </xsl:call-template>
64 <xsl:apply-templates mode="dita2html.inline.content.mode" select="$node"/>
65 </span>
66 </xsl:template>
67
68 <xsl:template mode="dita2html.inline.content.mode" match="*">
69 <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
70 <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
71 </xsl:template>
72
73
74 <!-- == Matched Templates == -->
75
76 <!-- = b = -->
77 <xsl:template mode="dita2html.topic.mode" match="&topic_b;">
78 <xsl:call-template name="dita2html.span"/>
79 </xsl:template>
80
81 <!-- = codeph = -->
82 <xsl:template mode="dita2html.topic.mode" match="&topic_codeph;">
83 <xsl:call-template name="dita2html.span">
84 <xsl:with-param name="class" select="'code'"/>
85 </xsl:call-template>
86 </xsl:template>
87
88 <!-- = cmdname = -->
89 <xsl:template mode="dita2html.topic.mode" match="&topic_cmdname;">
90 <xsl:call-template name="dita2html.span">
91 <xsl:with-param name="class" select="'cmd'"/>
92 </xsl:call-template>
93 </xsl:template>
94
95 <!-- = filepath = -->
96 <xsl:template mode="dita2html.topic.mode" match="&topic_filepath;">
97 <xsl:call-template name="dita2html.span">
98 <xsl:with-param name="class" select="'file'"/>
99 </xsl:call-template>
100 </xsl:template>
101
102 <!-- = i = -->
103 <xsl:template mode="dita2html.topic.mode" match="&topic_i;">
104 <xsl:call-template name="dita2html.span"/>
105 </xsl:template>
106
107 <!-- = menucascade = -->
108 <xsl:template mode="dita2html.topic.mode" match="&topic_menucascade;">
109 <xsl:call-template name="dita2html.span">
110 <xsl:with-param name="class" select="'guiseq'"/>
111 </xsl:call-template>
112 </xsl:template>
113
114 <!-- = menucascade % dita2html.inline.content.mode = -->
115 <xsl:template mode="dita2html.inline.content.mode" match="&topic_menucascade;">
116 <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
117 <xsl:for-each select="$conref">
118 <xsl:variable name="arrow">
119 <xsl:variable name="dir">
120 <xsl:call-template name="l10n.direction"/>
121 </xsl:variable>
122 <xsl:choose>
123 <xsl:when test="$dir = 'rtl'">
124 <xsl:text>&#x00A0;&#x25C2; </xsl:text>
125 </xsl:when>
126 <xsl:otherwise>
127 <xsl:text>&#x00A0;&#x25B8; </xsl:text>
128 </xsl:otherwise>
129 </xsl:choose>
130 </xsl:variable>
131 <xsl:for-each select="&topic_uicontrol;">
132 <xsl:if test="position() != 1">
133 <xsl:value-of select="$arrow"/>
134 </xsl:if>
135 <xsl:apply-templates mode="dita2html.topic.mode" select="."/>
136 </xsl:for-each>
137 </xsl:for-each>
138 </xsl:template>
139
140 <!-- = shortcut = -->
141 <xsl:template mode="dita2html.topic.mode" match="&topic_shortcut;">
142 <xsl:call-template name="dita2html.span">
143 <xsl:with-param name="class" select="'shortcut'"/>
144 </xsl:call-template>
145 </xsl:template>
146
147 <!-- = systemoutput = -->
148 <xsl:template mode="dita2html.topic.mode" match="&topic_systemoutput;">
149 <xsl:call-template name="dita2html.span">
150 <xsl:with-param name="class" select="'output'"/>
151 </xsl:call-template>
152 </xsl:template>
153
154 <!-- = text = -->
155 <xsl:template mode="dita2html.topic.mode" match="&topic_text;">
156 <xsl:call-template name="dita2html.span"/>
157 </xsl:template>
158
159 <!-- = tt = -->
160 <xsl:template mode="dita2html.topic.mode" match="&topic_tt;">
161 <xsl:call-template name="dita2html.span">
162 <xsl:with-param name="class" select="'sys'"/>
163 </xsl:call-template>
164 </xsl:template>
165
166 <!-- = u = -->
167 <xsl:template mode="dita2html.topic.mode" match="&topic_u;">
168 <xsl:call-template name="dita2html.span"/>
169 </xsl:template>
170
171 <!-- = uicontrol = -->
172 <xsl:template mode="dita2html.topic.mode" match="&topic_uicontrol;">
173 <xsl:call-template name="dita2html.span">
174 <xsl:with-param name="class" select="'gui'"/>
175 </xsl:call-template>
176 </xsl:template>
177
178 <!-- = userinput = -->
179 <xsl:template mode="dita2html.topic.mode" match="&topic_userinput;">
180 <xsl:call-template name="dita2html.span">
181 <xsl:with-param name="class" select="'input'"/>
182 </xsl:call-template>
183 </xsl:template>
184
185 <!-- = varname = -->
186 <xsl:template mode="dita2html.topic.mode" match="&topic_varname;">
187 <xsl:call-template name="dita2html.span">
188 <xsl:with-param name="class" select="'var'"/>
189 </xsl:call-template>
190 </xsl:template>
191
192 <!-- = wintitle = -->
193 <xsl:template mode="dita2html.topic.mode" match="&topic_wintitle;">
194 <xsl:call-template name="dita2html.span">
195 <xsl:with-param name="class" select="'gui'"/>
196 </xsl:call-template>
197 </xsl:template>
198
199 <!-- = xref = -->
200 <xsl:template mode="dita2html.topic.mode" match="&topic_xref;">
201 <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
202 <a>
203 <xsl:call-template name="html.class.attr"/>
204 <xsl:call-template name="html.lang.attrs"/>
205 <xsl:attribute name="href">
206 <xsl:call-template name="dita.ref.href.target">
207 <xsl:with-param name="node" select="."/>
208 <xsl:with-param name="conref" select="$conref"/>
209 </xsl:call-template>
210 </xsl:attribute>
211 <xsl:call-template name="dita.ref.href.content">
212 <xsl:with-param name="node" select="."/>
213 <xsl:with-param name="conref" select="$conref"/>
214 </xsl:call-template>
215 </a>
216 </xsl:template>
217
218 </xsl:stylesheet>