xsl:variable [modified]
-
Hi There, Found an xml article written in 2000 with following example: XML:
42AC5
Loopy Fruit Cereal 12 4.25H343A
MicroSecond Rice 14 2.35EA198
Crescent Toothpaste 18 1.95 XSL: You could then assign the total cost of the entire set of line items to a variable by using some of the built-in functions intrinsic to XPath: Implementing the above creates following error: Reference to variable or parameter 'lineItemSubTotals' must evaluate to a node list. Any suggestions? -- modified at 3:02 Monday 25th June, 2007 -
Hi There, Found an xml article written in 2000 with following example: XML:
42AC5
Loopy Fruit Cereal 12 4.25H343A
MicroSecond Rice 14 2.35EA198
Crescent Toothpaste 18 1.95 XSL: You could then assign the total cost of the entire set of line items to a variable by using some of the built-in functions intrinsic to XPath: Implementing the above creates following error: Reference to variable or parameter 'lineItemSubTotals' must evaluate to a node list. Any suggestions? -- modified at 3:02 Monday 25th June, 2007 -
The variable, $lineItemSubTotals, is a tree and not a node set (node list). Thus, you need to use "msxsl:node-set(string)":
<xsl:value-of select="sum(msxsl:node-set($lineItemSubTotals/subTotal))"