Try to grab pressure information from first DC if it is not manually
entered.

Signed-off-by: Miika Turkia <[email protected]>
---
 xslt/xml2manualcsv.xslt | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/xslt/xml2manualcsv.xslt b/xslt/xml2manualcsv.xslt
index 03e4178..6239bfe 100644
--- a/xslt/xml2manualcsv.xslt
+++ b/xslt/xml2manualcsv.xslt
@@ -37,7 +37,21 @@
         <xsl:apply-templates select="divecomputer[1]/temperature"/>
       </xsl:otherwise>
     </xsl:choose>
-    <xsl:apply-templates select="cylinder"/>
+    <xsl:choose>
+      <xsl:when test="cylinder/@start|cylinder/@end != ''">
+        <xsl:apply-templates select="cylinder"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$fs"/>
+        <xsl:text>&quot;</xsl:text>
+        <xsl:value-of select="divecomputer[1]/sample[@pressure]/@pressure"/>
+        <xsl:text>&quot;</xsl:text>
+        <xsl:value-of select="$fs"/>
+        <xsl:text>&quot;</xsl:text>
+        <xsl:value-of 
select="divecomputer[1]/sample[@pressure][last()]/@pressure"/>
+        <xsl:text>&quot;</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
     <xsl:apply-templates select="location"/>
     <xsl:apply-templates select="divemaster"/>
     <xsl:apply-templates select="buddy"/>
-- 
1.9.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to