summaryrefslogtreecommitdiffstats
path: root/xslt/commonTemplates.xsl
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-10-07 16:53:36 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-07 17:41:14 +0300
commitf0409123958fb41daefb5e0b22d2243598fa0c5f (patch)
tree947b1a2d93c4c7f00c577f849a5d9d8d3b9b09ac /xslt/commonTemplates.xsl
parent3f5b5f7b3ed632aecd1e439a6f1775755683f76f (diff)
downloadsubsurface-f0409123958fb41daefb5e0b22d2243598fa0c5f.tar.gz
CSV import: import of last field
The last field ends with new line instead of field separator. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/commonTemplates.xsl')
-rw-r--r--xslt/commonTemplates.xsl8
1 files changed, 5 insertions, 3 deletions
diff --git a/xslt/commonTemplates.xsl b/xslt/commonTemplates.xsl
index 18b50b739..74362df92 100644
--- a/xslt/commonTemplates.xsl
+++ b/xslt/commonTemplates.xsl
@@ -330,9 +330,8 @@
<xsl:choose>
<xsl:when test="substring($line, 1, 1) = '&quot;'">
<xsl:choose>
- <xsl:when test="substring-before(substring-after($line, '&quot;'), concat('&quot;', $fs)) != ''">
-
-
+ <!-- We either have a field that ends with quote and field separator, or the last character of line is quote -->
+ <xsl:when test="substring-before(substring-after($line, '&quot;'), concat('&quot;', $fs)) != '' or substring($line, string-length($line), 1)">
<xsl:choose>
<xsl:when test="substring-before(substring-before(substring-after($line, '&quot;'), concat('&quot;', $fs)), '&quot;') != ''">
<xsl:call-template name="unquote">
@@ -340,6 +339,9 @@
<xsl:with-param name="value" select="''" />
</xsl:call-template>
</xsl:when>
+ <xsl:when test="substring($line, string-length($line), 1) = '&quot;'">
+ <xsl:value-of select="substring-before(substring-after($line, '&quot;'), '&quot;')"/>
+ </xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-before(substring-after($line, '&quot;'), concat('&quot;', $fs))"/>