summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-07-11 21:30:18 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-11 12:07:43 -0700
commit964401c37402d5eabc8d31fd649345be0774d756 (patch)
tree650413173b4e99fc53a164a45e9db5a3f69f64e8 /xslt
parent745c9a130c53c70a38e233d5361ad412e6ae0dac (diff)
downloadsubsurface-964401c37402d5eabc8d31fd649345be0774d756.tar.gz
Add image support to UDDF export
This patch adds image support to UDDF export. As far as I can tell from the UDDF specification, the images can only be added to notes field, so that is what we do here. (buddy and owner can also have image tags, but that is irrelevant for Subsurface currently.) 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.xslt13
1 files changed, 13 insertions, 0 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 0de8b4904..285f3c233 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -4,6 +4,7 @@
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:key name="gases" match="cylinder" use="concat(substring-before(@o2, '.'), '/', substring-before(@he, '.'))" />
+ <xsl:key name="images" match="picture" use="concat(../../dive/@number|../dive/@number, ':', @filename, '@', @offset)" />
<xsl:template match="/divelog/dives">
<uddf version="3.2.0">
@@ -21,6 +22,15 @@
</datetime>
</xsl:if>
</generator>
+ <mediadata>
+ <xsl:for-each select="//picture[generate-id() = generate-id(key('images', concat(../../dive/@number|../dive/@number, ':', @filename, '@', @offset))[1])]">
+ <image id="{concat(../../dive/@number|../dive/@number, ':', @filename, '@', @offset)}">
+ <objectname>
+ <xsl:value-of select="@filename"/>
+ </objectname>
+ </image>
+ </xsl:for-each>
+ </mediadata>
<diver>
<owner id="1">
@@ -456,6 +466,9 @@
<para>
<xsl:value-of select="notes"/>
</para>
+ <xsl:for-each select="picture">
+ <link ref="{concat(../@number, ':', @filename, '@', @offset)}"/>
+ </xsl:for-each>
</notes>
<rating>
<ratingvalue>