【发布时间】:2017-10-04 11:16:15
【问题描述】:
我已经制作了这个 XSLT,但只是删除了非 ASCII 字符。
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:param name="charset" select="'@.1234567890 abcdefghilmnopqrstuvwzkyx ABCDEFGHILMNOPQRSTUVWZYKX'" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="translate(., translate(., $charset, ''), '')"/>
</xsl:template>
</xsl:stylesheet>
我想用一个简单的空格代替。 有什么线索吗?
【问题讨论】:
-
要调整的字符串是否有最大长度?
-
是的,最多 150 个字符。