mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
Support quoting strings with "" on manual CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a950365b6f
commit
7c23a08921
1 changed files with 37 additions and 9 deletions
|
@ -347,11 +347,36 @@
|
|||
<xsl:param name="line"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$index > 0">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring($line, 1, 1) = '"'">
|
||||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$index -1"/>
|
||||
<xsl:with-param name="line" select="substring-after($line, $fs)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$index -1"/>
|
||||
<xsl:with-param name="line" select="substring-after($line, $fs)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring($line, 1, 1) = '"'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring-before($line,'"$fs') != ''">
|
||||
<xsl:value-of select="substring-before($line,'"$fs')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="substring-after($line, '"$fs') = ''">
|
||||
<xsl:value-of select="substring-before(substring-after($line, '"'), '"')"/>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring-before($line,$fs) != ''">
|
||||
|
@ -365,5 +390,8 @@
|
|||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Add table
Reference in a new issue