summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
Diffstat (limited to 'xslt')
-rw-r--r--xslt/csv2xml.xslt12
1 files changed, 8 insertions, 4 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 5c9abfe1e..677e83613 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -96,10 +96,14 @@
</xsl:attribute>
<xsl:attribute name="temp">
- <xsl:call-template name="getFieldByIndex">
- <xsl:with-param name="index" select="$tempField"/>
- <xsl:with-param name="line" select="$line"/>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="$tempField >= 0">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$tempField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
</xsl:attribute>
</sample>
</xsl:if>