mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
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>
This commit is contained in:
parent
745c9a130c
commit
964401c374
1 changed files with 13 additions and 0 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue