[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Variables and constants
<gasp/> <xsl:for-each... inside <xsl:variable. It is nice to have mathematicians on the list :-) Gathers a list of nodes into the variable, then the sum 'adds 'em up' Impressed David. Regards, DaveP ><total xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xsl:version="1.0" > xmlns:xt="http://www.jclark.com/xt" > > > ><xsl:variable name="x"> > <xsl:for-each select="x/thing"> > <a><xsl:value-of select="quantity * price"/></a> > </xsl:for-each> ></xsl:variable> > ><xsl:value-of select="sum(xt:node-set($x)/a)"/> > ></total> > >xt basket.xml basket.xsl ><?xml version="1.0" encoding="utf-8"?> ><total>54</total> 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
|