Changeset 49964a5 in subsurface


Ignore:
Timestamp:
Jan 1, 2017, 1:40:21 AM (5 months ago)
Author:
Miika Turkia <miika.turkia@…>
Branches:
master
Children:
f28280d
Parents:
5db7d4bc
Message:

AV1 import: parse temperature

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xslt/av1.xslt

    r5db7d4bc r49964a5  
    5252            <xsl:with-param name="lineno" select="'0'"/>
    5353          </xsl:call-template>
     54          <xsl:if test="$remaining != ''">
     55            <xsl:call-template name="findTemp">
     56              <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
     57              <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
     58            </xsl:call-template>
     59          </xsl:if>
    5460        </sample>
    5561      </xsl:when>
     
    109115  </xsl:template>
    110116
     117  <xsl:template name="findTemp">
     118    <xsl:param name="line"/>
     119    <xsl:param name="remaining"/>
     120
     121    <xsl:if test="string(number(substring($line, 1, 1))) = 'NaN'">
     122      <xsl:choose>
     123        <xsl:when test="substring-before($line, '=') = 'Temp'">
     124          <xsl:attribute name="temp">
     125            <xsl:value-of select="substring-after($line, '= ')"/>
     126          </xsl:attribute>
     127        </xsl:when>
     128
     129        <xsl:otherwise>
     130          <xsl:if test="$remaining != ''">
     131            <xsl:call-template name="findTemp">
     132              <xsl:with-param name="line" select="substring-before($remaining, $lf)"/>
     133              <xsl:with-param name="remaining" select="substring-after($remaining, $lf)"/>
     134            </xsl:call-template>
     135          </xsl:if>
     136        </xsl:otherwise>
     137      </xsl:choose>
     138    </xsl:if>
     139  </xsl:template>
     140
    111141</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.