bogeyman said:
Like most of these sort of things, XSLT was designed by a comittee using RFCs as input.
Why they made node-set() function that turns tree fragment into node-set that is required in order to for-each it or do other things to it was not made mandatory and left up to implementators to implement or not to implement it, and in any case causing people to write code that will be specific to that implementor, ie msxml: prefix used for Microsoft stuff, what's the deep wisdom of such decision?
I look newsgroups around and lots of people ask same simple questions: how to assign to variable, how to break out of the loop. At best answers are inefficient lengthy workarounds, at worst just redirects to FAQ, which would say you can't do it.
Functional my arse - they have nice approach to match sets in XML using XPath, that's great (apart from limits in XPath but lets not get diverted), but wtf they
had to to cripple programmer after giving him powerful matching set?
XSLT is a false prophet - much like Chico's boss: a lot of promise, but once you try something non-trivial it become apparent that its a steaming crock of doodoo.
--------------
Here is example: in a set I needed to calculate number of the first X elements that satisfied given condition and once element found that does not satisfy such condition I need to stop counting, ie:
true
true
false
true
false
When looking for number of first trueths I would need to get number 2. How do I get this in XSLT when I can't break the loop? Tell me, I found solution but maybe yours will be much better than mine (which is crap but due to XSLT design crapness).