65
65
<xsl:attribute name="alt">
67
67
<xsl:when test="$inline">
68
<xsl:value-of select="$node"/>
68
<xsl:variable name="alt">
69
<xsl:apply-templates mode="mal2html.inline.mode" select="$node/node()"/>
71
<xsl:value-of select="normalize-space($alt)"/>
71
74
<!-- FIXME: This is not ideal. Nested block container elements
256
260
<xsl:template mode="mal2html.ttml.mode" match="tt:body">
258
<xsl:attribute name="class">
259
<xsl:text>media-ttml</xsl:text>
261
<xsl:when test="@xml:space">
262
<xsl:if test="@xml:space='preserve'">
263
<xsl:text> media-ttml-pre</xsl:text>
265
<xsl:if test="@xml:space='default'">
266
<xsl:text> media-ttml-nopre</xsl:text>
270
<xsl:if test="../@xml:space='preserve'">
271
<xsl:text> media-ttml-pre</xsl:text>
273
<xsl:if test="../@xml:space='default'">
274
<xsl:text> media-ttml-nopre</xsl:text>
262
<xsl:call-template name="html.class.attr">
263
<xsl:with-param name="class">
264
<xsl:text>media-ttml</xsl:text>
266
<xsl:when test="@xml:space">
267
<xsl:if test="@xml:space='preserve'">
268
<xsl:text> media-ttml-pre</xsl:text>
270
<xsl:if test="@xml:space='default'">
271
<xsl:text> media-ttml-nopre</xsl:text>
275
<xsl:if test="../@xml:space='preserve'">
276
<xsl:text> media-ttml-pre</xsl:text>
278
<xsl:if test="../@xml:space='default'">
279
<xsl:text> media-ttml-nopre</xsl:text>
279
285
<xsl:call-template name="html.lang.attrs">
280
286
<xsl:with-param name="parent" select="../self::tt:tt"/>
281
287
</xsl:call-template>
295
301
</xsl:call-template>
298
<xsl:attribute name="class">
299
<xsl:text>media-ttml-node media-ttml-div</xsl:text>
300
<xsl:if test="@xml:space='preserve'">
301
<xsl:text> media-ttml-pre</xsl:text>
303
<xsl:if test="@xml:space='default'">
304
<xsl:text> media-ttml-nopre</xsl:text>
304
<xsl:call-template name="html.class.attr">
305
<xsl:with-param name="class">
306
<xsl:text>media-ttml-node media-ttml-div</xsl:text>
307
<xsl:if test="@xml:space='preserve'">
308
<xsl:text> media-ttml-pre</xsl:text>
310
<xsl:if test="@xml:space='default'">
311
<xsl:text> media-ttml-nopre</xsl:text>
307
315
<xsl:call-template name="html.lang.attrs"/>
308
316
<xsl:copy-of select="@xml:space"/>
309
317
<xsl:attribute name="data-ttml-begin">
338
346
</xsl:call-template>
341
<xsl:attribute name="class">
342
<xsl:text>media-ttml-node media-ttml-p</xsl:text>
343
<xsl:if test="@xml:space='preserve'">
344
<xsl:text> media-ttml-pre</xsl:text>
346
<xsl:if test="@xml:space='default'">
347
<xsl:text> media-ttml-nopre</xsl:text>
349
<xsl:call-template name="html.class.attr">
350
<xsl:with-param name="class">
351
<xsl:text>media-ttml-node media-ttml-p</xsl:text>
352
<xsl:if test="@xml:space='preserve'">
353
<xsl:text> media-ttml-pre</xsl:text>
355
<xsl:if test="@xml:space='default'">
356
<xsl:text> media-ttml-nopre</xsl:text>
350
360
<xsl:call-template name="html.lang.attrs"/>
351
361
<xsl:attribute name="data-ttml-begin">
352
362
<xsl:value-of select="substring-before($beginend, ',')"/>
371
381
</xsl:call-template>
374
<xsl:attribute name="class">
375
<xsl:text>media-ttml-node media-ttml-span</xsl:text>
376
<xsl:if test="@xml:space='preserve'">
377
<xsl:text> media-ttml-pre</xsl:text>
379
<xsl:if test="@xml:space='default'">
380
<xsl:text> media-ttml-nopre</xsl:text>
384
<xsl:call-template name="html.class.attr">
385
<xsl:with-param name="class">
386
<xsl:text>media-ttml-node media-ttml-span</xsl:text>
387
<xsl:if test="@xml:space='preserve'">
388
<xsl:text> media-ttml-pre</xsl:text>
390
<xsl:if test="@xml:space='default'">
391
<xsl:text> media-ttml-nopre</xsl:text>
383
395
<xsl:call-template name="html.lang.attrs"/>
384
396
<xsl:attribute name="data-ttml-begin">
385
397
<xsl:value-of select="substring-before($beginend, ',')"/>
428
444
<xsl:when test="$if = ''"/>
429
445
<xsl:when test="@type = 'image' or not(@type)">
431
<xsl:attribute name="class">
432
<xsl:text>media media-image</xsl:text>
433
<xsl:value-of select="$class"/>
434
<xsl:if test="$if != 'true'">
435
<xsl:text> if-if </xsl:text>
436
<xsl:value-of select="$if"/>
447
<xsl:call-template name="html.class.attr">
448
<xsl:with-param name="class">
449
<xsl:text>media media-image</xsl:text>
450
<xsl:value-of select="$class"/>
451
<xsl:if test="$if != 'true'">
452
<xsl:text> if-if </xsl:text>
453
<xsl:value-of select="$if"/>
439
457
<div class="inner">
440
458
<xsl:call-template name="mal2html.media.image"/>
444
462
<xsl:when test="@type = 'video'">
446
<xsl:attribute name="class">
447
<xsl:text>media media-video</xsl:text>
448
<xsl:value-of select="$class"/>
449
<xsl:if test="$if != 'true'">
450
<xsl:text> if-if </xsl:text>
451
<xsl:value-of select="$if"/>
464
<xsl:call-template name="html.class.attr">
465
<xsl:with-param name="class">
466
<xsl:text>media media-video</xsl:text>
467
<xsl:value-of select="$class"/>
468
<xsl:if test="$if != 'true'">
469
<xsl:text> if-if </xsl:text>
470
<xsl:value-of select="$if"/>
454
474
<div class="inner">
455
475
<xsl:call-template name="mal2html.media.video"/>
459
479
<xsl:when test="@type = 'audio'">
461
<xsl:attribute name="class">
462
<xsl:text>media media-audio</xsl:text>
463
<xsl:value-of select="$class"/>
464
<xsl:if test="$if != 'true'">
465
<xsl:text> if-if </xsl:text>
466
<xsl:value-of select="$if"/>
481
<xsl:call-template name="html.class.attr">
482
<xsl:with-param name="class">
483
<xsl:text>media media-audio</xsl:text>
484
<xsl:value-of select="$class"/>
485
<xsl:if test="$if != 'true'">
486
<xsl:text> if-if </xsl:text>
487
<xsl:value-of select="$if"/>
469
491
<div class="inner">
470
492
<xsl:call-template name="mal2html.media.audio"/>
482
504
<!-- = mal2html.inline.mode % media = -->
483
505
<xsl:template mode="mal2html.inline.mode" match="mal:media">
485
<xsl:when test="@action | @xref | @href">
487
<xsl:attribute name="href">
488
<xsl:call-template name="mal.link.target"/>
490
<xsl:attribute name="title">
491
<xsl:call-template name="mal.link.tooltip"/>
493
<xsl:apply-templates mode="mal2html.inline.content.mode" select="."/>
497
<xsl:apply-templates mode="mal2html.inline.content.mode" select="."/>
506
<xsl:call-template name="mal2html.span"/>
502
509
<xsl:template mode="mal2html.inline.content.mode" match="mal:media">