summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-09-06 21:40:12 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-07 07:23:46 -0700
commitc8e542e5d38e49ae103e5723e4f1c7c6da83e228 (patch)
tree50093ecd104664902576f8b8de19b77048f460a8 /xslt
parent1cada7847e0325499eaedcffca47a8d9fa8400b7 (diff)
downloadsubsurface-c8e542e5d38e49ae103e5723e4f1c7c6da83e228.tar.gz
UDDF export: adapt to new dive site management
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/uddf-export.xslt57
1 files changed, 26 insertions, 31 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 4365702dc..cb6a66f98 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -127,7 +127,7 @@
<name>Subsurface Divebase</name>
</divebase>
- <xsl:apply-templates select="//location"/>
+ <xsl:apply-templates select="//site" mode="called"/>
</divesite>
<!-- Define all the unique gases found in the dive log -->
@@ -216,29 +216,26 @@
</xsl:choose>
</xsl:template>
- <xsl:key name="location" match="location" use="./@gps"/>
- <xsl:template match="location">
- <xsl:if test="generate-id() = generate-id(key('location', normalize-space(./@gps)))">
- <site xmlns="http://www.streit.cc/uddf/3.2/">
- <xsl:attribute name="id">
- <xsl:value-of select="generate-id()"/>
- </xsl:attribute>
- <name>
- <xsl:value-of select="."/>
- </name>
- <geography>
- <location>
- <xsl:value-of select="."/>
- </location>
- <latitude>
- <xsl:value-of select="substring-before(@gps, ' ')"/>
- </latitude>
- <longitude>
- <xsl:value-of select="substring-after(@gps, ' ')"/>
- </longitude>
- </geography>
- </site>
- </xsl:if>
+ <xsl:template match="site" mode="called">
+ <site xmlns="http://www.streit.cc/uddf/3.2/">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@uuid"/>
+ </xsl:attribute>
+ <name>
+ <xsl:value-of select="@name"/>
+ </name>
+ <geography>
+ <location>
+ <xsl:value-of select="@name"/>
+ </location>
+ <latitude>
+ <xsl:value-of select="substring-before(@gps, ' ')"/>
+ </latitude>
+ <longitude>
+ <xsl:value-of select="substring-after(@gps, ' ')"/>
+ </longitude>
+ </geography>
+ </site>
</xsl:template>
<xsl:template match="dive">
@@ -261,13 +258,11 @@
</link>
</xsl:for-each>
</xsl:for-each>
- <xsl:for-each select="location">
- <link>
- <xsl:attribute name="ref">
- <xsl:value-of select="generate-id(key('location',normalize-space(./@gps)))"/>
- </xsl:attribute>
- </link>
- </xsl:for-each>
+ <link>
+ <xsl:attribute name="ref">
+ <xsl:value-of select="@divesiteid"/>
+ </xsl:attribute>
+ </link>
<divenumber>
<xsl:value-of select="./@number"/>
</divenumber>