I have done quite a bit of XSLT in the past; and certainly enough to see that the XSLT sample in the tip is full of bad practices. To name a few:
- the use of xsl:for-each is generally considered bad practice, use xsl:apply-templates instead. XSLT is a functional language, not a procedural one.
- there is no need at all to use an extension function, the XSLT/XPath count() function will do just fine. Probably it will even do better, because it could be optimized by the XSLT compiler.
-more generally, extension functions are non-portable and should only be used for things you can't do in XSLT. In my experience, you hardly ever need them.
- the use of xsl:element and xsl:attribute to create output elements is only needed in specific (generally hairy) situations, and is certainly superfluous in the case of the article.
I am no expert either, but IMO the XSLT in the article looks like it was written by an absolute beginner in XSLT. The author hasn't wrapped his mind aroundthe (functional) concepts of XSLT yet. Which is a pity, because XSL can be highly elegant and concise when written well.