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>
This commit is contained in:
Miika Turkia 2018-10-07 16:53:36 +03:00 committed by Dirk Hohndel
parent 3f5b5f7b3e
commit f040912395

View file

@ -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))"/>