Changeset 9b9d065 in subsurface


Ignore:
Timestamp:
Jan 1, 2017, 3:28:06 AM (7 months ago)
Author:
Miika Turkia <miika.turkia@…>
Branches:
master
Children:
902a27d
Parents:
f28280d
Message:

AV1 import: grab NDL info

Signed-off-by: Miika Turkia <miika.turkia@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xslt/av1.xslt

    rf28280d r9b9d065  
    6060          <xsl:if test="$remaining != ''">
    6161            <xsl:call-template name="findTemp">
     62              <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
     63              <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
     64            </xsl:call-template>
     65          </xsl:if>
     66          <xsl:if test="$remaining != ''">
     67            <xsl:call-template name="findNDL">
    6268              <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
    6369              <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
     
    140146  </xsl:template>
    141147
     148  <xsl:template name="findNDL">
     149    <xsl:param name="line"/>
     150    <xsl:param name="remaining"/>
     151
     152    <xsl:if test="string(number(substring($line, 1, 1))) = 'NaN'">
     153      <xsl:choose>
     154        <xsl:when test="substring-before($line, '=') = 'NDL'">
     155          <xsl:if test="substring-after($line, '= -') = ''">
     156            <xsl:variable name="value">
     157              <xsl:value-of select="substring-after($line, '= ')"/>
     158            </xsl:variable>
     159            <xsl:attribute name="ndl">
     160              <xsl:value-of select="concat(floor($value div 60), ':', format-number($value mod 60, '00'), ' min')"/>
     161            </xsl:attribute>
     162          </xsl:if>
     163        </xsl:when>
     164
     165        <xsl:otherwise>
     166          <xsl:if test="$remaining != ''">
     167            <xsl:call-template name="findNDL">
     168              <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
     169              <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
     170            </xsl:call-template>
     171          </xsl:if>
     172        </xsl:otherwise>
     173      </xsl:choose>
     174    </xsl:if>
     175  </xsl:template>
     176
    142177</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.