On Wed, 14 Mar 2007 15:13:22 -0600, Abel Braaksma
<abel(_dot_)online(_at_)xs4all(_dot_)nl> 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:D
M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354 |
http://dev.aol.com/blog/3155
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--