Tôi không thực sự biết XSL nhưng tôi cần phải sửa mã này, tôi đã giảm nó để làm cho nó đơn giản hơn.
Tôi nhận được lỗi nàyXSLT chuỗi thay thế
Invalid XSLT/XPath function
trên dòng này
<xsl:variable name="text" select="replace($text,'a','b')"/>
Đây là 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>
bất cứ ai có thể cho tôi biết những gì xảy ra với nó?
Xin lưu ý rằng hàm 'replace()' có sẵn từ XPath 2.0 (và do đó XSLT 2.0) trở đi và hỗ trợ các thay thế biểu thức chính quy. – Abel