|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] sum of price * qty, without node-set()
greetings all,
i'm a newbie and am trying to get a sum of a calculation; i'm hoping to get the value "162.00". <BATCH>
<RECEIPT>
<qtyRcpt>1</qtyRcpt>
<line>
<pr>102.00</pr>
</line>
</RECEIPT>
<RECEIPT>
<qtyRcpt>3</qtyRcpt>
<line>
<pr>20.00</pr>
</line>
</RECEIPT>
</BATCH>i've seen this FAQ: http://www.dpawson.co.uk/xsl/sect2/N5121.html#d5351e202 but without the sample xml, i can't really understand it. i've also seen posts that use the "node-set()" function. but i'm not able to successfully get the exslt stuff to work. <xsl:template match="BATCH">
<xsl:variable name="tmpTotal">
<xsl:for-each select="RECEIPT">
<item>
<xsl:value-of select="( qtyRcpt * line/pr )"/>
</item>
</xsl:for-each>
</xsl:variable><xsl:variable name="myTotal" select="exslt:node-set($tmpTotal)"/> <xsl:value-of select="sum($myTotal/item)" /> </xsl:template> so, i'd really like to be able to do this in native XSLT 1.0 (without node-set). could someone please point me in the right direction? seems like it would be really simple. i've been pounding my head for hours. thanks. -charles XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








