summaryrefslogtreecommitdiffstats
path: root/xslt/commonTemplates.xsl
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-03-19 22:41:49 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-19 13:49:21 -0700
commit6a98588ed02320c4d33c1d848c38a424c90448f3 (patch)
tree3130343c541dde27451ee813206f0b78f15cfd5b /xslt/commonTemplates.xsl
parent9b35381cf2fb906f32c4ba4bdfd2f5b423218334 (diff)
downloadsubsurface-6a98588ed02320c4d33c1d848c38a424c90448f3.tar.gz
Added support for UDDf version 3.1
This adds support for UDDF version 3.1 as produced by at least DiversDiary. Basically we have to include the different name space into our selections. This patch also checks if the temperature is zero on all samples and skips temperature readings if it looks like the dive computer does not record them. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/commonTemplates.xsl')
-rw-r--r--xslt/commonTemplates.xsl16
1 files changed, 16 insertions, 0 deletions
diff --git a/xslt/commonTemplates.xsl b/xslt/commonTemplates.xsl
index ba649970a..87af4d686 100644
--- a/xslt/commonTemplates.xsl
+++ b/xslt/commonTemplates.xsl
@@ -131,4 +131,20 @@
</xsl:choose>
</xsl:template>
+ <!-- Trying to see if we have temperature readings -->
+ <xsl:template name="temperatureSamples">
+ <xsl:param name="units"/>
+ <xsl:choose>
+ <xsl:when test="$units = 'Imperial'">
+ <xsl:value-of select="count(descendant::temperature[. != 32])"/>
+ </xsl:when>
+ <xsl:when test="$units = 'Kelvin'">
+ <xsl:value-of select="count(descendant::temperature[. != 273.15])"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="count(descendant::temperature[. != 0])"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
</xsl:stylesheet>