So, I have a variable containing a nodeset with several Size nodes
<xsl:variable name="sizes" select="$filter/Size" />
I then, need to do a sum on another nodeset, where the Size/@ID exists in this $sizes variable
<xsl:value-of select="sum(Sizes/Size[ **where @ID in $sizes/@ID** ]/@Value)"/>
But I'm struggling on how I write this XPath...in xslt 1.0
<xsl:value-of select="sum(Sizes/Size[@ID = $sizes/@ID]/@Value)"/>
if I understand your spec correctly.
This works because of "existential quantification": A = B
means "some member of node set A is equal to some member of node set B". (In your case, A has at most only one member anyway.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With