~ubuntu-branches/ubuntu/saucy/yelp-xsl/saucy

« back to all changes in this revision

Viewing changes to xslt/mallard/html/mal2html-list.xsl

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2013-05-30 09:55:02 UTC
  • mfrom: (11.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130530095502-uqkc9bzuod7xqrmn
Tags: 3.8.1-2
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
20
                xmlns:mal="http://projectmallard.org/1.0/"
21
 
                xmlns:ui="http://projectmallard.org/experimental/ui/"
 
21
                xmlns:ui="http://projectmallard.org/ui/1.0/"
 
22
                xmlns:uix="http://projectmallard.org/experimental/ui/"
22
23
                xmlns:str="http://exslt.org/strings"
23
24
                xmlns="http://www.w3.org/1999/xhtml"
24
 
                exclude-result-prefixes="mal ui str"
 
25
                exclude-result-prefixes="mal ui uix str"
25
26
                version="1.0">
26
27
 
27
28
<!--!!==========================================================================
54
55
    <xsl:call-template name="html.lang.attrs"/>
55
56
    <xsl:attribute name="class">
56
57
      <xsl:text>list</xsl:text>
57
 
      <xsl:if test="mal:title and @ui:expanded">
 
58
      <xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
58
59
        <xsl:text> ui-expander</xsl:text>
59
60
      </xsl:if>
60
61
      <xsl:if test="$if != 'true'">
78
79
              <xsl:value-of select="concat('list-style-type:', @type)"/>
79
80
            </xsl:attribute>
80
81
          </xsl:if>
 
82
          <xsl:if test="contains(concat(' ', @style, ' '), ' continues ')">
 
83
            <xsl:attribute name="start">
 
84
              <xsl:call-template name="mal.list.start"/>
 
85
            </xsl:attribute>
 
86
          </xsl:if>
81
87
          <xsl:apply-templates select="mal:item"/>
82
88
        </xsl:element>
83
89
      </div>
110
116
    <xsl:call-template name="html.lang.attrs"/>
111
117
    <xsl:attribute name="class">
112
118
      <xsl:text>steps</xsl:text>
113
 
      <xsl:if test="mal:title and @ui:expanded">
 
119
      <xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
114
120
        <xsl:text> ui-expander</xsl:text>
115
121
      </xsl:if>
116
122
      <xsl:if test="$if != 'true'">
123
129
      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
124
130
      <div class="region">
125
131
        <ol class="steps">
 
132
          <xsl:if test="contains(concat(' ', @style, ' '), ' continues ')">
 
133
            <xsl:attribute name="start">
 
134
              <xsl:call-template name="mal.list.start"/>
 
135
            </xsl:attribute>
 
136
          </xsl:if>
126
137
          <xsl:apply-templates select="mal:item"/>
127
138
        </ol>
128
139
      </div>
131
142
</xsl:if>
132
143
</xsl:template>
133
144
 
 
145
<xsl:template name="mal.list.start">
 
146
  <xsl:param name="node" select="."/>
 
147
  <xsl:choose>
 
148
    <xsl:when test="contains(concat(' ', $node/@style, ' '), ' continues ')">
 
149
      <xsl:variable name="prevlist"
 
150
                    select="$node/preceding::*[name(.) = name($node)]
 
151
                            [not(@type) and not($node/@type) or (@type = $node/@type)][1]"/>
 
152
      <xsl:choose>
 
153
        <xsl:when test="count($prevlist) = 0">1</xsl:when>
 
154
        <xsl:otherwise>
 
155
          <xsl:variable name="prevlength" select="count($prevlist/mal:item)"/>
 
156
          <xsl:variable name="prevstart">
 
157
            <xsl:call-template name="mal.list.start">
 
158
              <xsl:with-param name="node" select="$prevlist"/>
 
159
            </xsl:call-template>
 
160
          </xsl:variable>
 
161
          <xsl:value-of select="$prevstart + $prevlength"/>
 
162
        </xsl:otherwise>
 
163
      </xsl:choose>
 
164
    </xsl:when>
 
165
    <xsl:otherwise>
 
166
      <xsl:text>1</xsl:text>
 
167
    </xsl:otherwise>
 
168
  </xsl:choose>
 
169
</xsl:template>
 
170
 
134
171
<!-- = steps/item = -->
135
172
<xsl:template match="mal:steps/mal:item">
136
173
  <xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
156
193
    <xsl:call-template name="html.lang.attrs"/>
157
194
    <xsl:attribute name="class">
158
195
      <xsl:text>terms</xsl:text>
159
 
      <xsl:if test="mal:title and @ui:expanded">
 
196
      <xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
160
197
        <xsl:text> ui-expander</xsl:text>
161
198
      </xsl:if>
162
199
      <xsl:if test="$if != 'true'">
226
263
      <xsl:if test="$lines">
227
264
        <xsl:text> tree-lines</xsl:text>
228
265
      </xsl:if>
229
 
      <xsl:if test="mal:title and @ui:expanded">
 
266
      <xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
230
267
        <xsl:text> ui-expander</xsl:text>
231
268
      </xsl:if>
232
269
      <xsl:if test="$if != 'true'">