Add 'trip' support to UDDF export

Currently repetition groups are used to group dives into trips. This
is not really correct. Repetition groups should really represent a
group of dives where tissue loading needs to be preserved between
dives (typically the same day).

UDDF has support for trips, using the <divetrip> tags. This is a
bidirectional link between the dives and the trips.

This patch adds support for these trips. However, it leaves in the
repetition groups. Repetition groups may need further consideration.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Martin Long 2014-12-10 22:46:53 +00:00 committed by Dirk Hohndel
parent 719cfe0ece
commit 71949b20d4

View file

@ -149,6 +149,7 @@
</gasdefinitions>
<profiledata>
<xsl:for-each select="trip">
<repetitiongroup id="{generate-id(.)}">
<xsl:apply-templates select="dive"/>
@ -160,6 +161,11 @@
</repetitiongroup>
</xsl:for-each>
</profiledata>
<divetrip>
<xsl:apply-templates select="//trip"/>
</divetrip>
</uddf>
</xsl:template>
@ -260,6 +266,9 @@
<xsl:value-of select="sum(xt:node-set($trimmedweightlist)/weight)"/>
</leadquantity>
</equipmentused>
<xsl:if test="parent::trip">
<tripmembership><xsl:value-of select="../@location"/>&#xA0;<xsl:value-of select="../@date"/></tripmembership>
</xsl:if>
</informationbeforedive>
<samples>
@ -573,6 +582,25 @@
</dive>
</xsl:template>
<xsl:template match="trip">
<trip id="{@location} {@date}">
<trippart>
<name><xsl:value-of select="@location"/>&#xA0;<xsl:value-of select="@date"/></name>
<relateddives>
<xsl:for-each select="dive">
<link ref="{generate-id(.)}"/>
</xsl:for-each>
</relateddives>
<xsl:if test="notes != ''">
<notes>
<para>
<xsl:value-of select="notes"/>
</para>
</notes>
</xsl:if>
</trippart>
</trip>
</xsl:template>
<!-- Approximate waypoint depth.
Parameters: