summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-01-01 11:40:21 +0200
committerGravatar Miika Turkia <miika.turkia@gmail.com>2017-01-01 11:40:21 +0200
commit49964a552beeca9621acbdc8bdcc7629fd077713 (patch)
tree574f2732a4a4b0ff3f10656bb43b3b93bb6c6f0a /xslt
parent5db7d4bcd7c85e8fe3ec29566fa6cfd822ced720 (diff)
downloadsubsurface-49964a552beeca9621acbdc8bdcc7629fd077713.tar.gz
AV1 import: parse temperature
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/av1.xslt30
1 files changed, 30 insertions, 0 deletions
diff --git a/xslt/av1.xslt b/xslt/av1.xslt
index 70bcecdbd..740eadd20 100644
--- a/xslt/av1.xslt
+++ b/xslt/av1.xslt
@@ -51,6 +51,12 @@
<xsl:with-param name="line" select="$line"/>
<xsl:with-param name="lineno" select="'0'"/>
</xsl:call-template>
+ <xsl:if test="$remaining != ''">
+ <xsl:call-template name="findTemp">
+ <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
+ <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
+ </xsl:call-template>
+ </xsl:if>
</sample>
</xsl:when>
<xsl:otherwise>
@@ -108,4 +114,28 @@
</xsl:attribute>
</xsl:template>
+ <xsl:template name="findTemp">
+ <xsl:param name="line"/>
+ <xsl:param name="remaining"/>
+
+ <xsl:if test="string(number(substring($line, 1, 1))) = 'NaN'">
+ <xsl:choose>
+ <xsl:when test="substring-before($line, '=') = 'Temp'">
+ <xsl:attribute name="temp">
+ <xsl:value-of select="substring-after($line, '= ')"/>
+ </xsl:attribute>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:if test="$remaining != ''">
+ <xsl:call-template name="findTemp">
+ <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
+ <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
</xsl:stylesheet>