[PATCH 4/7] Fix divecomputer part of UDDF export

Martin Long martin at longhome.co.uk
Fri Dec 12 16:34:37 PST 2014


XPath was incorrect for parsing divecomputers into the equipment
section, meaning they dont get inserted.

Signed-off-by: Martin Long <martin at longhome.co.uk>
---
 xslt/uddf-export.xslt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index a5e2266..0114ca3 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -6,6 +6,7 @@
 
   <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:key name="divecomputer" match="divecomputer" use="@deviceid" />
 
   <!-- This needs to be set at this top level so that it is avialable in both the buddies and profiledata sections-->
   <xsl:variable name="buddies">
@@ -52,7 +53,7 @@
       <diver>
         <owner id="owner">
           <equipment>
-            <xsl:for-each select="/divelog/settings/divecomputerid">
+            <xsl:for-each select="//dive/divecomputer[generate-id() = generate-id(key('divecomputer', @deviceid)[1])]">
               <divecomputer id="{./@deviceid}">
                 <name>
                   <xsl:choose>
-- 
1.9.1



More information about the subsurface mailing list