aboutsummaryrefslogtreecommitdiffstats
path: root/xslt/udcf.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-03-02 13:10:38 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-02 08:42:54 -0800
commitaa02798e2a6ca1a91dbfe444327f5eeb61744ea6 (patch)
treedbc895dcdac1a8cadf831a7b7af53d98df8e52bf /xslt/udcf.xslt
parente89c2fd656c94c60cdb2d51d1451ff86daf559d0 (diff)
downloadsubsurface-aa02798e2a6ca1a91dbfe444327f5eeb61744ea6.tar.gz
Dive computer import improvements
Parse dive computer information or divelog generator information and include it as divecomputerid and divecomputer as appropriate. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/udcf.xslt')
-rw-r--r--xslt/udcf.xslt24
1 files changed, 24 insertions, 0 deletions
diff --git a/xslt/udcf.xslt b/xslt/udcf.xslt
index 982516fee..4f3362638 100644
--- a/xslt/udcf.xslt
+++ b/xslt/udcf.xslt
@@ -5,12 +5,30 @@
<xsl:template match="/">
<divelog program="subsurface" version="2">
+ <settings>
+ <divecomputerid deviceid="ffffffff">
+ <xsl:apply-templates select="/PROFILE/DEVICE|/profile/device"/>
+ </divecomputerid>
+ </settings>
<dives>
<xsl:apply-templates select="/PROFILE/REPGROUP/DIVE|/profile/repgroup/dive"/>
</dives>
</divelog>
</xsl:template>
+ <xsl:template match="DEVICE|device">
+ <xsl:if test="MODEL|model != ''">
+ <xsl:attribute name="model">
+ <xsl:value-of select="MODEL|model"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="version|VERSION != ''">
+ <xsl:attribute name="serial">
+ <xsl:value-of select="VERSION|version"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
<xsl:template match="DIVE|dive">
<dive>
<xsl:attribute name="date">
@@ -39,6 +57,12 @@
</temperature>
</xsl:if>
+ <divecomputer deviceid="ffffffff">
+ <xsl:attribute name="model">
+ <xsl:value-of select="/PROFILE/DEVICE/MODEL|/profile/device/model"/>
+ </xsl:attribute>
+ </divecomputer>
+
<xsl:for-each select="GASES/MIX|gases/mix">
<cylinder>
<xsl:attribute name="description">