1
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
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
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
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
19
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
xmlns:mal="http://projectmallard.org/1.0/"
21
xmlns:ui="http://projectmallard.org/experimental/ui/"
22
xmlns="http://www.w3.org/1999/xhtml"
23
exclude-result-prefixes="mal ui"
26
<!--!!==========================================================================
27
Mallard to HTML - UI Extension
28
Support for Mallard UI extension elements.
30
This stylesheet contains templates to support features from the Mallard UI
35
<!--**==========================================================================
36
mal2html.ui.expander.data
37
Output data for an expander.
38
:Revision:version="1.0" date="2011-06-14" status="final"
39
$node: The source element to output data for.
40
$expander: Whether ${node} is actually an expander.
42
This template outputs an HTML #{div} element with the #{class} attribute set to
43
#{"yelp-data yelp-data-ui-expander"}. All #{yelp-data} elements are hidden by
44
the CSS. The div contains information about text directionality, the default
45
expanded state, and optionally additional titles for the expanded and collapsed
48
The expander information is only output if the ${expander} parameter is #{true}.
49
This parameter can be calculated automatically, but it will give false negatives
50
for blocks that produce automatic titles.
52
<xsl:template name="mal2html.ui.expander.data">
53
<xsl:param name="node" select="."/>
54
<xsl:param name="expander" select="$node/mal:title and
55
($node/@ui:expanded or $node/self::ui:expander)"/>
56
<xsl:if test="$expander">
57
<xsl:variable name="title_e" select="$node/mal:info/mal:title[@type = 'ui:expanded'][1]"/>
58
<xsl:variable name="title_c" select="$node/mal:info/mal:title[@type = 'ui:collapsed'][1]"/>
59
<div class="yelp-data yelp-data-ui-expander">
60
<xsl:attribute name="dir">
61
<xsl:call-template name="l10n.direction"/>
63
<xsl:attribute name="data-yelp-expanded">
65
<xsl:when test="$node/self::ui:expander/@expanded = 'no'">
66
<xsl:text>no</xsl:text>
68
<xsl:when test="$node/@ui:expanded = 'no'">
69
<xsl:text>no</xsl:text>
72
<xsl:text>yes</xsl:text>
76
<xsl:if test="$title_e">
77
<div class="yelp-title-expanded">
78
<xsl:apply-templates mode="mal2html.inline.mode" select="$title_e/node()"/>
81
<xsl:if test="$title_c">
82
<div class="yelp-title-collapsed">
83
<xsl:apply-templates mode="mal2html.inline.mode" select="$title_c/node()"/>