summaryrefslogtreecommitdiffstats
path: root/xslt/uddf.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-12-13 22:00:36 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-13 13:18:16 -0800
commita06ce34123f6e836fd0a17c799ef45d4e6b66d22 (patch)
tree1ecb72cb37abdd7338b673c16d14a720bca477cb /xslt/uddf.xslt
parent1c7efda5e17a3d9e439680644a37ba9c483ed011 (diff)
downloadsubsurface-a06ce34123f6e836fd0a17c799ef45d4e6b66d22.tar.gz
Include dive buddies on uddf import
Adjust to UDDF 3.2 specification Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/uddf.xslt')
-rw-r--r--xslt/uddf.xslt26
1 files changed, 26 insertions, 0 deletions
diff --git a/xslt/uddf.xslt b/xslt/uddf.xslt
index d941d4f82..14a163f2c 100644
--- a/xslt/uddf.xslt
+++ b/xslt/uddf.xslt
@@ -180,6 +180,32 @@
</xsl:if>
</xsl:for-each>
+ <xsl:variable name="buddies">
+ <xsl:for-each select="u:informationbeforedive/u:link">
+ <xsl:variable name="ref">
+ <xsl:value-of select="@ref"/>
+ </xsl:variable>
+ <xsl:for-each select="//u:diver/u:buddy[@id = $ref]/u:personal/u:firstname|//u:diver/u:buddy[@id = $ref]/u:personal/u:lastname">
+ <xsl:value-of select="."/>
+ <xsl:if test="following-sibling::* != ''">
+ <xsl:value-of select="' '"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:variable name="next">
+ <xsl:value-of select="following-sibling::u:link/@ref"/>
+ </xsl:variable>
+ <xsl:if test="//u:diver/u:buddy[@id = $next]/u:personal/u:firstname != ''">
+ <xsl:value-of select="', '"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="$buddies != ''">
+ <buddy>
+ <xsl:value-of select="$buddies"/>
+ </buddy>
+ </xsl:if>
+
<xsl:if test="buddy_ref/@ref|informationbeforedive/buddy_ref/@ref != ''">
<buddy>
<xsl:variable name="ref">