[PATCH] Fix importing CSV files with empty values

Miika Turkia miika.turkia at gmail.com
Thu Jan 23 10:33:41 UTC 2014


Empty values included the rest of the line in the value, instead of
leaving it empty. This patch leaves empty values empty.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/csv2xml.xslt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index eb4c876..ee8b755 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -194,7 +194,9 @@
             <xsl:value-of select="substring-before($line,$fs)"/>
           </xsl:when>
           <xsl:otherwise>
-            <xsl:value-of select="$line"/>
+            <xsl:if test="substring-after($line, $fs) = ''">
+              <xsl:value-of select="$line"/>
+            </xsl:if>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:otherwise>
-- 
1.8.3.2



More information about the subsurface mailing list