diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2013-03-02 09:22:08 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-03-01 23:49:09 -0800 |
commit | 0f9142b4e3ea3a46f7cee95cf9363c5fd3264ad3 (patch) | |
tree | 10780500736925c6a3a90113c7bd02a18fa7d9cb /xslt/uddf.xslt | |
parent | 51d20880210d990e35982137067cda1801460d0a (diff) | |
download | subsurface-0f9142b4e3ea3a46f7cee95cf9363c5fd3264ad3.tar.gz |
Grab a bit more info from UDDF import
otu and po2 are now grabbed. The po2 value comes from setpo2 tag. Also
divecomputerid is constructed from the generator information.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/uddf.xslt')
-rw-r--r-- | xslt/uddf.xslt | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/xslt/uddf.xslt b/xslt/uddf.xslt index 1b45ccad6..d06747878 100644 --- a/xslt/uddf.xslt +++ b/xslt/uddf.xslt @@ -9,20 +9,34 @@ <xsl:template match="/"> <divelog program="subsurface" version="2"> + <settings> + <divecomputerid deviceid="ffffffff"> + <xsl:apply-templates select="/uddf/generator|/u:uddf/u:generator"/> + </divecomputerid> + </settings> <dives> <xsl:apply-templates select="/uddf/profiledata/repetitiongroup/dive|/u:uddf/u:profiledata/u:repetitiongroup/u:dive"/> </dives> </divelog> </xsl:template> - <!-- Print warning if we don't handle some element --> - <xsl:template match="*"> - <xsl:message terminate="no"> - WARNING: Unmatched element: <xsl:value-of select="name()"/> - </xsl:message> - - <xsl:apply-templates/> - </xsl:template> + <xsl:template match="generator|u:generator"> + <xsl:if test="manufacturer/name|u:manufacturer/u:name != ''"> + <xsl:attribute name="model"> + <xsl:value-of select="manufacturer/name|/u:manufacturer/u:name"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="name|u:name != ''"> + <xsl:attribute name="firmware"> + <xsl:value-of select="name|u:name"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="version|u:version != ''"> + <xsl:attribute name="serial"> + <xsl:value-of select="version|u:version"/> + </xsl:attribute> + </xsl:if> + </xsl:template> <xsl:template match="gasdefinitions|u:gasdefinitions"> <xsl:for-each select="u:mix|mix"> @@ -150,16 +164,25 @@ </xsl:attribute> </xsl:if> - <!-- otu --> - <xsl:if test="cns > 0"> - <xsl:attribute name="cns"> - <xsl:value-of select="concat(cns, ' C')"/> + <xsl:if test="otu|u:otu > 0"> + <xsl:attribute name="otu"> + <xsl:value-of select="otu|u:otu"/> </xsl:attribute> </xsl:if> - <xsl:if test="u:cns > 0"> + <xsl:if test="cns|u:cns > 0"> <xsl:attribute name="cns"> - <xsl:value-of select="concat(u:cns, ' C')"/> + <xsl:value-of select="concat(cns|u:cns, ' C')"/> + </xsl:attribute> + </xsl:if> + + <xsl:if test="setpo2|u:setpo2 != ''"> + <xsl:attribute name="po2"> + <xsl:call-template name="convertPascal"> + <xsl:with-param name="value"> + <xsl:value-of select="setpo2|u:setpo2"/> + </xsl:with-param> + </xsl:call-template> </xsl:attribute> </xsl:if> </sample> |