summaryrefslogtreecommitdiffstats
path: root/xslt/MacDive.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/MacDive.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/MacDive.xslt')
-rw-r--r--xslt/MacDive.xslt28
1 files changed, 11 insertions, 17 deletions
diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index f3c87386a..8faa429b1 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -5,10 +5,16 @@
<xsl:template match="/">
<divelog program='subsurface' version='2'>
<settings>
- <divecomputer>
- <xsl:apply-templates select="/dives/dive/computer"/>
- <xsl:apply-templates select="/dives/dive/serial"/>
- </divecomputer>
+ <xsl:for-each select="/dives/dive">
+ <divecomputerid deviceid="ffffffff">
+ <xsl:attribute name="model">
+ <xsl:value-of select="computer"/>
+ </xsl:attribute>
+ <xsl:attribute name="serial">
+ <xsl:value-of select="serial"/>
+ </xsl:attribute>
+ </divecomputerid>
+ </xsl:for-each>
</settings>
<dives>
<xsl:apply-templates select="/dives/dive"/>
@@ -16,18 +22,6 @@
</divelog>
</xsl:template>
- <xsl:template match="computer">
- <xsl:attribute name="model">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
-
- <xsl:template match="serial">
- <xsl:attribute name="serial">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
-
<xsl:template match="dive">
<xsl:variable name="units" select="/dives/units"/>
@@ -152,7 +146,7 @@
<xsl:value-of select="notes"/>
</notes>
- <divecomputer>
+ <divecomputer deviceid="ffffffff">
<xsl:attribute name="model">
<xsl:value-of select="computer"/>
</xsl:attribute>