Sunday, January 27, 2008

Free XSLT Debugger: Visual Studio (2005/2008)

I know Visual Studio 2005 has been around for quite some time now, but I'm still discovering new things that it can do. I'm a light weight when it comes to XSLT and so I was definitely going to need some help when it came time to transform some RSS into an HTML document.

I actually spent some time online digging around for a good XSLT IDE and found some pretty complete offerings, unfortunately a lot of them also wanted a fair bit of money. What really surprised me is when I discovered that Visual Studio will actually debug XSLT! I remember back in the day this was a HUGE feature that we wished VS 2003 had (a company I was working for at the time ended up buying a plug in from Active State which did just that). What's even better is that Visual Studio 2008 will actually show you where you are in the XML document as you debug. It's important to note that this is available for all editions (Express to Team). I'm ever more surprised at just how many features you can get in a free IDE these days. Any way here's what the debugging experience looks like.

Steps to Debug

  1. Fire up Visual Studio, File->New->XSLT File.
  2. In the properties pane (press F4 if it's not already visible) enter the Input file (could be an XML file or a URL).
  3. Type out some XSLT (with intellisense) an when you want to check your markup put down a break point (press F9), navigate to XML->Debug XSLT.
  4. You can now enjoy a full debugging session and evaluate XPath and XSLT expressions on the fly either in the Quick Watch window or the Immediate window.

Not too shabby for zero dollars.

Cheers,
Tyler

2 comments:

Anonymous said...

This feature in visual studio is really great. it helped me a lot.

mayno224 said...

Was looking forward to this feature. Unfortunately, it's not available in the Express edition as incorrectly stated in the article.

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/41b3f770-ad69-4935-af2c-b61e1e059e8c