|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: counting loop in xslt
Pfitzner, Jan wrote: > is there a possibility to implement a counting loop without using an extension in xslt?? You may realize this already, but in case you didn't... incrementing a counter is a procedural programming solution, while XSLT is a functional language. Sometimes you do have to resort to using recursion or an extension, but often there is a way to achieve the results you want without resorting to using a counter at all, let alone incrementing it. The most common problems are solved using careful selection of nodes using the select attribute on an xsl:for-each or xsl:apply-templates, and utilizing position() when processing those nodes. Perhaps if you explained the problem in terms of the input you've got and the output you want, we could suggest another approach that would be more elegant and efficient, and that would allow you to add functional programming to your resume. :) Or not. Like I said, not all problems can be solved this way. It's just such a FAQ that we usually as "why do you think you need a counter?" before we tell you how to simulate one :) - Mike ____________________________________________________________________________ mike j. brown | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/ 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








