<xsl:copy-of select="current-group()"/> 在 XSLT 3.0 中显示无效的 xpath

<xsl:copy-of select="current-group()"/> shows invalid xpath in XSLT 3.0

这个 xslt 有什么错误?它在 行中显示无效的 xpath,尽管当我使用 xslt 2.0 版(无流)时它工作正常。

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:wd="urn:com.workday/bsvc" 
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
    exclude-result-prefixes="xs"
    version="3.0">
    
    <xsl:mode streamable="yes" on-no-match="shallow-skip"/>
    
    <xsl:param name="BlockSize" as="xs:integer" select="2000"/>
    
    <xsl:strip-space elements="*"/>
    <xsl:output indent="yes"/>
    
   
    
    <xsl:template match="/">
        <root>
            <xsl:for-each-group select="root/wd:Get_Workers_Response/wd:Response_Data/wd:Worker" group-adjacent="floor((position() -1) div $BlockSize)">
                <group>
                    <xsl:copy-of select="current-group()"/>     <-- ERROR - Invalid Xpath
                </group>
            </xsl:for-each-group>            
        </root>
    </xsl:template>
    
</xsl:stylesheet>

在这里,我试图将 xml 中的工人列表分成几组,每组 2000 名工人。

Saxon 9.7(以及更高版本)可以毫无问题地接受此样式表。

我强烈怀疑您没有将 Workday 正确配置为 运行 XSLT 2.0。

要验证这一点,请尝试 运行创建一个简单的样式表(在 XSLT 1.0 下工作,但指定 version="2.0" 以防影响处理器的选择),输出 system-property('xsl:vendor')system-property('xsl:version').

此外,请引用准确的错误消息,而不是解释它。错误消息的确切措辞通常是表明您使用的 XSLT 处理器的线索 运行ning。

问题出在配置上。禁用 xsl 验证器(window > 首选项 > 验证)解决了这个问题。