The basic scenario is simple: sum a series of values.
I want to sum all values except where the value of nodeB has a substring at the end the contains 2 specific characters. They are utilized as identifiers.
I know that this substring comparison works correctly (where Var2 has a string length of 2):
<xsl:when test="substring($Var1, (string-length($Var1) - string-length($Var2))+1) = 'XY'">
So, I was thinking that I could apply that same logic within the summation methodology
<xsl:variable name="Var3" select="sum(nodeA/nodeB[substring(/ValueOfNodeB, (string-length(/ValueOfNodeB) - string-length('XY'))+1) != 'XY']/nodeC/nodeD)"/>
I think that I am very close, and in fact the above line compiles and performs the summation, but doesn't perform the exclusion.
I would appreciate any thoughts or guidance.
Thanks in advance.