[yelp-xsl] mal2html-media: Support h and m time units for TTML
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] mal2html-media: Support h and m time units for TTML
- Date: Wed, 29 Feb 2012 18:12:21 +0000 (UTC)
commit 1c76e921be02059d8423e200cda65d8960d1e258
Author: Shaun McCance <shaunm gnome org>
Date: Wed Feb 29 12:22:44 2012 -0500
mal2html-media: Support h and m time units for TTML
xslt/mallard/html/mal2html-media.xsl | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/xslt/mallard/html/mal2html-media.xsl b/xslt/mallard/html/mal2html-media.xsl
index 766cf19..932bd82 100644
--- a/xslt/mallard/html/mal2html-media.xsl
+++ b/xslt/mallard/html/mal2html-media.xsl
@@ -313,15 +313,22 @@ FIXME
<xsl:template name="mal2html.ttml.time.seconds">
<xsl:param name="time" select="0"/>
+ <xsl:variable name="time_" select="normalize-space($time)"/>
<xsl:choose>
- <xsl:when test="substring($time, string-length($time) - 1) = 'ms'">
+ <xsl:when test="substring($time_, string-length($time_) - 1) = 'ms'">
<xsl:variable name="ms">
- <xsl:value-of select="substring($time, 1, string-length($time) - 2)"/>
+ <xsl:value-of select="substring($time_, 1, string-length($time_) - 2)"/>
</xsl:variable>
<xsl:value-of select="number($ms) div 1000"/>
</xsl:when>
- <xsl:when test="substring($time, string-length($time)) = 's'">
- <xsl:value-of select="substring($time, 1, string-length($time) - 1)"/>
+ <xsl:when test="substring($time_, string-length($time_)) = 's'">
+ <xsl:value-of select="substring($time_, 1, string-length($time_) - 1)"/>
+ </xsl:when>
+ <xsl:when test="substring($time_, string-length($time_)) = 'm'">
+ <xsl:value-of select="60 * number(substring($time_, 1, string-length($time_) - 1))"/>
+ </xsl:when>
+ <xsl:when test="substring($time_, string-length($time_)) = 'h'">
+ <xsl:value-of select="3600 * number(substring($time_, 1, string-length($time_) - 1))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]