Visual Studio has the ability to debug XSL stylesheets. This a extremely useful feature that a few seem to know exist and use regularly.
Most of the projects I'm involved with use XSLT in one way or another. And the VS debugger along with other tools have saved me countless hours of frustration.
Here's a quick guide to get you started:
- Create / Open up the XSL file using Visual Studio
- Setup break points as necessary
- Make sure that the XML Editor toolbar is visible
- Click on the Debug XSLT button to start debugging
- A warning message would appear asking you to setup an input file. This would be the XML file that needs to be transformed. Click YES and select the input file.
- Step through the code.
The only disadvantage or limitation rather is that you can't specify values for xsl:param variables. The workaround I use is to re-define the parameter as an xsl:variable , set the expected input value.
On a related note, XslCompiledTransform class supports stepping into the stylesheet while debugging. The only pre-requisite is that the class should be instantiated with the debug parameter value set to true . Detailed instructions provided here.
1 comment:
That button is disabled for me
How can i get it enabled?
I followed your steps exaclty.
I can see the button,
it's just disabled.
Post a Comment