summaryrefslogtreecommitdiffstats
path: root/xslt/uddf-export.xslt
diff options
context:
space:
mode:
authorGravatar Martin Long <martin@longhome.co.uk>2014-12-09 23:24:48 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-10 08:14:22 -0700
commitaa74cd8802f53e23be2be233ae166113a7f30486 (patch)
treee34ed06e97183c15ecb63ff9ff0230176d1e1864 /xslt/uddf-export.xslt
parentb462a8da3547202ba812ffcb265cbf29c9fb803f (diff)
downloadsubsurface-aa74cd8802f53e23be2be233ae166113a7f30486.tar.gz
Update dive site structure in UDDF export to match UDDF 3.2.0 specification.
The dive site structure in the UDDF export was using an old structure where each site is simply listed as a <dive_site>. The new structure requires a single <divesite> containing at least one <divebase> - a base location where you are diving from, and at least one <site>. As subsurface only tracks sites, I've created a single divebase to be referenced by all of the sites. Note: although profiles in Subsurface can be grouped into trips, these are groupings of profiles, not sites, and the mapping may not be simple. e.g. on different trips the sames sites may be visited but a different base used. Or, different bases may be used on a single trip. Signed-off-by: Marton Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/uddf-export.xslt')
-rw-r--r--xslt/uddf-export.xslt33
1 files changed, 20 insertions, 13 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 011b695d4..c7004eed4 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -78,7 +78,15 @@
</xsl:for-each>
</diver>
- <xsl:apply-templates select="//location"/>
+ <divesite>
+
+ <!-- There must be at least one divebase. Subsurface doesn't track this as a concept, so just assign them all to a single divebase. -->
+ <divebase id="allbase">
+ <name>Subsurface Divebase</name>
+ </divebase>
+
+ <xsl:apply-templates select="//location"/>
+ </divesite>
<!-- Define all the unique gases found in the dive log -->
<gasdefinitions>
@@ -163,27 +171,26 @@
<xsl:key name="location" match="location" use="."/>
<xsl:template match="location">
<xsl:if test="generate-id() = generate-id(key('location', normalize-space(.)))">
- <dive_site>
+ <site>
<xsl:attribute name="id">
<xsl:value-of select="."/>
</xsl:attribute>
<name>
<xsl:value-of select="."/>
</name>
+ <link ref="allbase"/>
<geography>
<location>
<xsl:value-of select="."/>
</location>
- <gps>
- <latitude>
- <xsl:value-of select="substring-before(@gps, ' ')"/>
- </latitude>
- <longitude>
- <xsl:value-of select="substring-after(@gps, ' ')"/>
- </longitude>
- </gps>
+ <latitude>
+ <xsl:value-of select="substring-before(@gps, ' ')"/>
+ </latitude>
+ <longitude>
+ <xsl:value-of select="substring-after(@gps, ' ')"/>
+ </longitude>
</geography>
- </dive_site>
+ </site>
</xsl:if>
</xsl:template>
@@ -219,11 +226,11 @@
</link>
</xsl:for-each>
<xsl:if test="location != ''">
- <dive_site_ref>
+ <link>
<xsl:attribute name="ref">
<xsl:value-of select="location"/>
</xsl:attribute>
- </dive_site_ref>
+ </link>
</xsl:if>
</informationbeforedive>