Re: [xsl] FizzBuzz in XSLT 1.0. Help with a 2.0/FXSL solution?

Subject: Re: [xsl] FizzBuzz in XSLT 1.0. Help with a 2.0/FXSL solution?
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Wed, 14 Mar 2007 15:39:15 -0600
On Wed, 14 Mar 2007 15:13:22 -0600, Abel Braaksma <> wrote:

> Though others have already provided good solutions, I couldn't resist upon reading your request. Coming from a Perl world, I like one-liners, and though very much against any spirit of clear code, here's a version that does away with if-statements altogether (oops, I see now that David C's second approach already had that).

This is great!  I've updated the update post accordingly.

One thing I am finding interesting about this excercise, and while this wasn't the original intention of the post, is just how much more efficient XSLT 2.0 is over XSLT 1.0.  Okay, obviously if I or anybody else spent longer than 10 minutes writing the XSLT 1.0 example, it could be quite a bit more readable and efficient, but even still, there's no way on earth you could accomplish anything even close to the efficiency of an XSLT 2.0 solution.  If nothing else, this provides a nice example of just how much better XSLT 2.0 is over XSLT 1.0 in regards to efficiency, verboseness, and the ability to read and understand the code.


M. David Peterson | |

Current Thread