diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-11-25 23:06:01 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-25 14:47:09 -0800 |
commit | 7e36b4a25386659dfafa82dd11bd7aa6e24aea8f (patch) | |
tree | b595dc578c168edb3bb33e108a07234f5319b359 /xslt | |
parent | 5e04aaa75664ecc5525d2d0a7bbd8b96d97c3b35 (diff) | |
download | subsurface-7e36b4a25386659dfafa82dd11bd7aa6e24aea8f.tar.gz |
Tidy up csv to xml xslt
Use if around the attribute, instead if a choose inside. Its less
horrible on the eyes.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/csv2xml.xslt | 72 |
1 files changed, 32 insertions, 40 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt index 8017c4599..fda0b6724 100644 --- a/xslt/csv2xml.xslt +++ b/xslt/csv2xml.xslt @@ -99,49 +99,41 @@ </xsl:call-template> </xsl:attribute> - <xsl:attribute name="temp"> - <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> + <xsl:if test="$tempField >= 0"> + <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:attribute> + </xsl:if> - <xsl:attribute name="po2"> - <xsl:choose> - <xsl:when test="$po2Field >= 0"> - <xsl:call-template name="getFieldByIndex"> - <xsl:with-param name="index" select="$po2Field"/> - <xsl:with-param name="line" select="$line"/> - </xsl:call-template> - </xsl:when> - </xsl:choose> - </xsl:attribute> + <xsl:if test="$po2Field >= 0"> + <xsl:attribute name="po2"> + <xsl:call-template name="getFieldByIndex"> + <xsl:with-param name="index" select="$po2Field"/> + <xsl:with-param name="line" select="$line"/> + </xsl:call-template> + </xsl:attribute> + </xsl:if> - <xsl:attribute name="cns"> - <xsl:choose> - <xsl:when test="$cnsField >= 0"> - <xsl:call-template name="getFieldByIndex"> - <xsl:with-param name="index" select="$cnsField"/> - <xsl:with-param name="line" select="$line"/> - </xsl:call-template> - </xsl:when> - </xsl:choose> - </xsl:attribute> + <xsl:if test="$cnsField >= 0"> + <xsl:attribute name="cns"> + <xsl:call-template name="getFieldByIndex"> + <xsl:with-param name="index" select="$cnsField"/> + <xsl:with-param name="line" select="$line"/> + </xsl:call-template> + </xsl:attribute> + </xsl:if> - <xsl:attribute name="otu"> - <xsl:choose> - <xsl:when test="$otuField >= 0"> - <xsl:call-template name="getFieldByIndex"> - <xsl:with-param name="index" select="$otuField"/> - <xsl:with-param name="line" select="$line"/> - </xsl:call-template> - </xsl:when> - </xsl:choose> - </xsl:attribute> + <xsl:if test="$otuField >= 0"> + <xsl:attribute name="otu"> + <xsl:call-template name="getFieldByIndex"> + <xsl:with-param name="index" select="$otuField"/> + <xsl:with-param name="line" select="$line"/> + </xsl:call-template> + </xsl:attribute> + </xsl:if> <xsl:if test="$stopdepthField >= 0"> <xsl:variable name="stopdepth"> |