[Home] [By Thread] [By Date] [Recent Entries]
On 07/05/2010 23:34, Costello, Roger L. wrote:
I do not believe that this task can be accomplished using xsl:for-each. why not? > Do you agree? No. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:stylesheet>
It's (probably, unless Michael rewrites it aggressively behind the scenes) an algorithm with theoretically greater computational complexity than the versions using + (order n squared instead of linear) but it's a lot easier to read and write and unless there are hundreds of siblings the complexity may not matter, <xsl:if test="following-sibling::Transaction"> <xsl:apply-templates select="following-sibling::Transaction[1]"> the xsl:if isn't needed as if the test is false the apply-templates wouldn't do anything anyway. As Dimitre has already said, you can't give general advice about which kind of algorithm is superior, it depends a lot on whether the system does tail recursion elimination on the explicitly recursive forms, so like most optimisation questions the answers are system specific. David
|

Cart



