如何从字符串+ xslt中删除连字符

时间:2016-07-20 13:21:07

标签: xslt substring hyphen

如何从字符串中删除连字符,如" 19650512-0065"到" 196505120065"

使用此模板:传递ID =

   <xsl:template name="unformatLFPartyID">
        <xsl:param name="theID" select="." />

        <xsl:variable name="idSuffix" select="string-length($theID) - 3" />

        <xsl:choose>
            <xsl:when test="contains($theID,'-')">
                <xsl:value-of select="substring($theID,0,$idSuffix)" />
                <xsl:value-of select="substring($theID, $idSuffix)" />
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$theID" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template> 

1 个答案:

答案 0 :(得分:1)

尝试将Data type Range Storage bigint -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807) 8 Bytes int -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647) 4 Bytes smallint -2^15 (-32,768) to 2^15-1 (32,767) 2 Bytes tinyint 0 to 255 1 Byte 和整个xsl:variable替换为:

xsl:choose