[PATCH 7/7] Fixed airtemperature in UDDF export.

Martin Long martin at longhome.co.uk
Tue Dec 9 15:24:53 PST 2014


The XSLT didn't expect the temperature tag to be within the
<divecomputer> element in the source, so the selection wasn't finding
it.
---
 xslt/uddf-export.xslt | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index b4c3cd9..c0a4948 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -202,12 +202,14 @@
   <xsl:template match="dive">
     <dive id="{generate-id(.)}">
 
-      <informationbeforedive>
-        <xsl:if test="temperature/@air|divetemperature/@air != ''">
-          <airtemperature>
-            <xsl:value-of select="format-number(substring-before(temperature/@air|divetemperature/@air, ' ') + 273.15, '0.00')"/>
-          </airtemperature>
-        </xsl:if>
+      <informationbeforedive> 
+        <xsl:for-each select="divecomputer">
+          <xsl:if test="temperature/@air|divetemperature/@air != ''">
+            <airtemperature>
+              <xsl:value-of select="format-number(substring-before(temperature/@air|divetemperature/@air, ' ') + 273.15, '0.00')"/>
+            </airtemperature>
+          </xsl:if>
+        </xsl:for-each>
         <datetime>
           <xsl:value-of select="concat(./@date, 'T', ./@time)"/>
         </datetime>
-- 
1.9.1



More information about the subsurface mailing list