]> git.tdb.fi Git - ext/subsurface.git/blobdiff - xslt/SuuntoSDM.xslt
Fix more Suunto SDM xml conversion problems
[ext/subsurface.git] / xslt / SuuntoSDM.xslt
index 45c151209bb2004af4dd46e81ed6f306a31b0d24..64564adf1b6b5a375cc377ef4f5767b698055a61 100644 (file)
         </xsl:otherwise>
       </xsl:choose>
 
+      <notes>
       <xsl:if test="LOGNOTES != ''">
         <xsl:value-of select="LOGNOTES" />
       </xsl:if>
+      <xsl:if test="WEATHER != ''">
+        Weather: <xsl:value-of select="WEATHER" />
+      </xsl:if>
+      </notes>
 
 <!-- FIXME: add support for multiple cylinders, need sample data -->
       <cylinder>
           <xsl:value-of select="concat(HEPCT, '%')"/>
         </xsl:attribute>
       </xsl:if>
+      <xsl:if test="CYLINDERDESCRIPTION != ''">
+        <xsl:attribute name="description">
+          <xsl:value-of select="CYLINDERDESCRIPTION"/>
+        </xsl:attribute>
+      </xsl:if>
       <xsl:if test="CYLINDERSIZE != ''">
         <xsl:attribute name="size">
             <xsl:choose>
-              <xsl:when test="CYLINDERWORKPRESSURE = '0'">
+              <xsl:when test="CYLINDERUNITS = '0'">
                 <xsl:value-of select="concat(CYLINDERSIZE, ' l')"/>
               </xsl:when>
               <xsl:otherwise>
   <xsl:template name="cuft2l">
     <xsl:param name="size"/>
     <xsl:param name="pressure"/>
-    <xsl:value-of select="concat(format-number((($size*28.3168466) div ($pressure div 1013.25)), '0.000'), ' l')" />
+    <xsl:choose>
+      <xsl:when test="$pressure != '0'">
+        <xsl:value-of select="concat(format-number((($size*28.3168466) div ($pressure div 1013.25)), '0.000'), ' l')" />
+      </xsl:when>
+      <xsl:otherwise>0</xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
   <!-- end cuft2l -->