Error : "An accumulator rule that matches attribute or namespace nodes has no effect"

Error : "An accumulator rule that matches attribute or namespace nodes has no effect"

这是我的数据

    <ECC>
       <Grp EId="2123" CC="1"/>
       <Grp EId="4345" CC="1"/>
       <Grp EId="1074" CC="2"/>
       <Grp EId="1254" CC="1"/>
       <Grp EId="1342" CC="3"/>
       <Grp EId="1261" CC="1"/>
    </ECC>

我正在尝试使用它

将其加载到累加器中
    <xsl:accumulator name="CurrentLookupValue" as="xs:string" initial-value="''" streamable="yes">
        <xsl:accumulator-rule match="ECC/Grp/@EId/text()" select="."/>
    </xsl:accumulator>

    <xsl:accumulator name="EmplIDLookup" as="map(xs:string,xs:decimal)" initial-value="map{}"
        streamable="yes">
        <xsl:accumulator-rule match="ECC/Grp/@CC/text()"
            select="map:put($value, accumulator-before('CurrentLookupValue'), xs:decimal(.))"/>
    </xsl:accumulator>

我收到警告 "An accumulator rule that matches attribute or namespace nodes has no effect"

文档说 "Pattern defining the set of nodes to which the accumulator rule applies" 有使用属性的解决方法吗? 或者我应该在节点中创建这个 xml 吗?

@EId/text() 没有任何意义,因为属性节点没有任何子节点。

一般来说,即使使用流式传输,您也可以在匹配元素节点时读出属性,我认为您只是想要

<xsl:accumulator name="CurrentLookupValue" as="xs:string" initial-value="''" streamable="yes">
    <xsl:accumulator-rule match="ECC/Grp" select="string(@EId)"/>
</xsl:accumulator>

<xsl:accumulator name="EmplIDLookup" as="map(xs:string,xs:decimal)" initial-value="map{}"
    streamable="yes">
    <xsl:accumulator-rule match="ECC/Grp"
        select="map:put($value, accumulator-before('CurrentLookupValue'), xs:decimal(@CC))"/>
</xsl:accumulator>

或者只是一个累加器

<xsl:accumulator name="EmplIDLookup" as="map(xs:string,xs:decimal)" initial-value="map{}"
    streamable="yes">
    <xsl:accumulator-rule match="ECC/Grp"
        select="map:put($value, string(@EId), xs:decimal(@CC))"/>
</xsl:accumulator>