Determine if a String is a Number

Tips:

number(node) != ‘NaN’

Sample:

<xsl:variable name=”inDisc”>
    <xsl:value-of select="./DiscountPercent"/>
</xsl:variable>
<xsl:variable name="DiscPct">
    <xsl:value-of select="number($inDisc)"/>
</xsl:variable>
<xsl:element name="UnitDiscountAmount">
    <xsl:choose>
        <xsl:when test="$DiscPct!='NaN'">
            <xsl:value-of select="$DiscPct"/>
        </xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
    </xsl:choose>
</xsl:element>

你可能感兴趣的:(String)