【发布时间】:2022-01-08 10:08:29
【问题描述】:
最近我升级了我的服务器,以下带有 Saxonb-XSLT 的 XSLT 停止工作:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output cdata-section-elements="title"/>
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="title[ends-with(., 'Apple') or ends-with(., 'Samsung') or ends-with(., 'Banana')]">
<xsl:copy>
<xsl:value-of select="let $words := tokenize(., '\s+')
return (subsequence($words, 1, count($words) - 2), $words[last()], $words[last() - 1])"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
我得到错误:
XPST0003: XPath syntax error at char 0 on line 13 in {let $}:
'let' is not supported in XPath
我还没有升级 saxonb-xslt(来自 Saxonica 的 Saxon 9.1.0.8J)。有人知道为什么它不能正常工作吗?
【问题讨论】: