嗨,这适用于","和其他分隔符,但它不适用于PIPE(|)符号只有它给FORX0003:tokenize()中的正则表达式不能与零长度字符串匹配
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text/text()" name="tokenize">
<xsl:param name="separator" select="'|'"/>
<xsl:for-each select="tokenize(.,$separator)">
<item>
<xsl:value-of select="normalize-space(.)"/>
</item>
</xsl:for-each>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
xslt ×1