相关疑难解决方法(0)

XSLT字符串替换

我真的不知道XSL但是我需要修复这个代码,我已经减少了它以使它更简单.
我收到了这个错误

无效的XSLT/XPath函数

在这条线上

<xsl:variable name="text" select="replace($text,'a','b')"/>
Run Code Online (Sandbox Code Playgroud)

这是XSL

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:inm="http://www.inmagic.com/webpublisher/query" version="1.0">
    <xsl:output method="text" encoding="UTF-8" />

    <xsl:preserve-space elements="*" />
    <xsl:template match="text()" />

    <xsl:template match="mos">
        <xsl:apply-templates />

        <xsl:for-each select="mosObj">
          'Notes or subject' 
           <xsl:call-template
                name="rem-html">
                <xsl:with-param name="text" select="SBS_ABSTRACT" />
            </xsl:call-template>
        </xsl:for-each>
    </xsl:template>

    <xsl:template name="rem-html">
        <xsl:param name="text" />
        <xsl:variable name="text" select="replace($text, 'a', 'b')" />
    </xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)

谁能告诉我它有什么问题?

xslt xpath replace xpath-1.0 xslt-1.0

82
推荐指数
5
解决办法
29万
查看次数

标签 统计

replace ×1

xpath ×1

xpath-1.0 ×1

xslt ×1

xslt-1.0 ×1