Subject: RE: [xsl] More addition questions: Using node-set() From: "Chaudhary, Harsh" <HCHAUDHA@xxxxxxxxx> Date: Thu, 11 Oct 2007 09:24:32 -0500 |
Hi, I used node-set in conjunction with some exslt functions (math:max etc.) to get this done. I have a question however about how node-set() works. E.g., if I get a result fragment tree(by doing something like //a meaning get all the elements that are needed), convert it to a node-set() and then use it, and I do this 2-3 times for different problem sets in say the same template, isn't there a lot of redunancy going on? Is there like a design pattern for doing multi-pass (I hope this is what is called a multi-pass) transformations? Harsh. -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Wednesday, October 10, 2007 4:18 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] More addition questions > I am using Xalan and XSLT 1.0 for the following since xalan supports exslt:node-set I'd use that which will allow you to use sum() on the numbers you have already generated. <top> <xsl:variable name="x"> what you have.. </xsl:variable> <xsl:copy-of select="$x"/> <sumOfAGroup> <xsl:for-each select="exslt:node-set($x)/top/sumsForEachElementByKeyMultipliedByPositi on"> <sum><xsl:value-of select="sum(element)"/></sum> </sumOfAGroup> </xsl:for-each> </top> David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] More addition questions, David Carlisle | Thread | RE: [xsl] More addition questions: , Michael Kay |
RE: [xsl] Windows Batchfile calling, Paul Spencer | Date | RE: [xsl] More addition questions: , Michael Kay |
Month |