0
是有價值的(內存,CPU時間)做這樣的:鍵和計數優化
<xsl:variable name="node" select="key('mykey',category)"/>
<xsl:value-of select="count($node[value/text() = 10.0])"/>
<xsl:value-of select="count($node[value/text() = 5.0])"/>
<xsl:value-of select="count($node[value/text() = 0.0])"/>
代替:
<xsl:value-of select="count(key('mykey',category)[value/text() = 10.0])"/>
<xsl:value-of select="count(key('mykey',category)[value/text() = 5.0])"/>
<xsl:value-of select="count(key('mykey',category)[value/text() = 0.0])"/>
還是另闢蹊徑?