[PATCH 1/2] Add the missed csv-field stopdepth

Anton Lundin glance at acc.umu.se
Mon Nov 25 14:06:00 UTC 2013


I managed to mess up and grab parts of my unfinished otu field code and
squash it into the wrong patch. Here is the code for stopdepth, and now
the code sets the in_deco flag to.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 xslt/csv2xml.xslt | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 07aa91d..8017c45 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -8,6 +8,7 @@
   <xsl:param name="po2Field" select="po2Field"/>
   <xsl:param name="cnsField" select="cnsField"/>
   <xsl:param name="otuField" select="otuField"/>
+  <xsl:param name="stopdepthField" select="stopdepthField"/>
   <xsl:param name="date" select="date"/>
   <xsl:param name="time" select="time"/>
   <xsl:output method="xml" indent="yes"/>
@@ -141,6 +142,25 @@
               </xsl:when>
           </xsl:choose>
         </xsl:attribute>
+
+        <xsl:if test="$stopdepthField >= 0">
+          <xsl:variable name="stopdepth">
+            <xsl:call-template name="getFieldByIndex">
+              <xsl:with-param name="index" select="$stopdepthField"/>
+              <xsl:with-param name="line" select="$line"/>
+            </xsl:call-template>
+          </xsl:variable>
+          <xsl:attribute name="stopdepth">
+            <xsl:copy-of select="$stopdepth"/>
+          </xsl:attribute>
+
+          <xsl:attribute name="in_deco">
+            <xsl:choose>
+              <xsl:when test="$stopdepth > 0">1</xsl:when>
+              <xsl:otherwise>0</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </xsl:if>
       </sample>
     </xsl:if>
   </xsl:template>
-- 
1.8.3.2



More information about the subsurface mailing list