Tuesday, March 04, 2008

XSLT

I never thought that I would like XSLT and I hoped that I wouldn't have to learn this "wimpy web language" which is how I used to see it. But after this weekend, I am a big XSLT fan.  Which is appropriate because this month marks the 10 year anniversary of XML.

So why is XSLT so cool? I think I would have embraced it much sooner had someone made this simple comparison for me: XSTL is like TSQL. I love TSQL: it is so powerful for getting and manipulating data. It is blazing fast and it takes way way fewer lines of code than it would take in .NET. XSLT is similar because both TSQL and XSTL are declarative languages: they focus on saying what do do rather than how to do it. When writing TSQL or XSLT I only have to say what I want done, and the parsing engine is responsible for figuring out how to do it.

Another way to look at these two languages is that they do one thing really really well: TSQL manipulates data in a database, and XSLT transforms XML.

I strongly recommend the Wrox XML book: Beginning XML. I spent most of my Saturday looking at other XML books, but I always seem to come back to Wrox. They are just so so much better than everything else. Some of the other XML books are just embarrassing and it is a shame that bookstores sell them to poor unsuspecting victims who read them and end up being more confused than when they started reading those horrible books. My advice: stick with Wrox.

<xsl:template match="/">
  <html>
    <body>
      <h3>I love XSLT</h3>
    </body>
  </html>
</xsl:template>

1 comment:

lu said...

hi mate, you spell beijing wrongly as "bejing" under your picture. nice pic