diff options
author | Martin Long <martin@longhome.co.uk> | 2014-12-10 22:46:53 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-10 15:51:05 -0700 |
commit | 71949b20d474077324687baeded527cf8d5d4a20 (patch) | |
tree | aa7aea232b633e693a9fc369e5162dcdf704a54e /xslt/uddf-export.xslt | |
parent | 719cfe0ece89aa162df7910fd8a2641c774d76fb (diff) | |
download | subsurface-71949b20d474077324687baeded527cf8d5d4a20.tar.gz |
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>
Diffstat (limited to 'xslt/uddf-export.xslt')
-rw-r--r-- | xslt/uddf-export.xslt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt index d4683ee12..2f7ba7056 100644 --- a/xslt/uddf-export.xslt +++ b/xslt/uddf-export.xslt @@ -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"/> <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"/> <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: |