Changeset 62c7abc in subsurface


Ignore:
Timestamp:
Apr 1, 2017, 8:06:09 AM (3 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
8bb9eb5
Parents:
919cfc9d
git-author:
Miika Turkia <miika.turkia@…> (03/29/17 10:03:06)
git-committer:
Dirk Hohndel <dirk@…> (04/01/17 08:06:09)
Message:

Only import weight if available

Signed-off-by: Miika Turkia <miika.turkia@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xslt/manualcsv2xml.xslt

    r919cfc9d r62c7abc  
    422422
    423423      <xsl:if test="$weightField >= 0">
    424         <weightsystem description="imported">
    425           <xsl:attribute name="weight">
    426             <xsl:variable name="weight">
    427               <xsl:call-template name="getFieldByIndex">
    428                 <xsl:with-param name="index" select="$weightField"/>
    429                 <xsl:with-param name="line" select="$line"/>
    430               </xsl:call-template>
    431             </xsl:variable>
    432             <xsl:choose>
    433               <xsl:when test="$units = 0">
    434                 <xsl:value-of select="translate($weight, translate($weight, '1234567890,.', ''), '')"/>
    435               </xsl:when>
    436               <xsl:otherwise>
    437                 <xsl:value-of select="translate(translate($weight, translate($weight, '1234567890,.', ''), ''), ',', '.') div 2.2046"/>
    438               </xsl:otherwise>
    439             </xsl:choose>
    440           </xsl:attribute>
    441         </weightsystem>
     424        <xsl:variable name="weight">
     425          <xsl:call-template name="getFieldByIndex">
     426            <xsl:with-param name="index" select="$weightField"/>
     427            <xsl:with-param name="line" select="$line"/>
     428          </xsl:call-template>
     429        </xsl:variable>
     430
     431        <xsl:if test="translate($weight, translate($weight, '1234567890,.', ''), '') > 0">
     432          <weightsystem description="imported">
     433            <xsl:attribute name="weight">
     434              <xsl:choose>
     435                <xsl:when test="$units = 0">
     436                  <xsl:value-of select="translate($weight, translate($weight, '1234567890,.', ''), '')"/>
     437                </xsl:when>
     438                <xsl:otherwise>
     439                  <xsl:value-of select="translate(translate($weight, translate($weight, '1234567890,.', ''), ''), ',', '.') div 2.2046"/>
     440                </xsl:otherwise>
     441              </xsl:choose>
     442            </xsl:attribute>
     443          </weightsystem>
     444        </xsl:if>
    442445      </xsl:if>
    443446
Note: See TracChangeset for help on using the changeset viewer.