diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2016-11-03 17:36:57 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-11-05 12:54:02 -0700 |
commit | caf14865b4d7ea5278661a8171b69ada1a9d8ec9 (patch) | |
tree | b98ab435403a8129f59162b8f765ada74fd66810 /xslt | |
parent | 3f060c5c282d654f044815dc688c49f33ed9d21f (diff) | |
download | subsurface-caf14865b4d7ea5278661a8171b69ada1a9d8ec9.tar.gz |
DL7 import: ignore non-numeric pressure
If pressure field is empty, we do not want to have field separator as
pressure value. This would flood the console with parsing error
messages.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/csv2xml.xslt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt index 3d998850c..3c62111fb 100644 --- a/xslt/csv2xml.xslt +++ b/xslt/csv2xml.xslt @@ -413,14 +413,16 @@ <xsl:with-param name="line" select="$line"/> </xsl:call-template> </xsl:variable> - <xsl:choose> - <xsl:when test="$units = 0"> - <xsl:value-of select="$pressure"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat(format-number(($pressure div 14.5037738007), '#'), ' bar')"/> - </xsl:otherwise> - </xsl:choose> + <xsl:if test="$pressure >= 0"> + <xsl:choose> + <xsl:when test="$units = 0"> + <xsl:value-of select="$pressure"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat(format-number(($pressure div 14.5037738007), '#'), ' bar')"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> </xsl:attribute> </xsl:if> </sample> |