tags:

views:

102

answers:

2

HI, We are using NANT build scripts in our project. The scenario is as follows, In my Application I create an application( this is basically UI based, the user drags, drops widgets etc, these are stored as xml internally). then while I say Build application, we use NANT scripts to call XSLT transform, I do not know if it is possible to debug the NANT scrips and the XSLTs called from NANT script in VS or some other debugging tool, Can anybody suggest a way to debug this.

Thanks, Sid

+1  A: 

Hello

There are some nAnt debugging tools out there, some of them you have to buy and some are free, or free for limited uses. NAntBuilder is one example, but that did not work very well for my multi-file build scripts.

I have always had success by adding tasks to print out what is going on. Admittedly this is old-school and crude, but it does get the job done :-)

For your specific debugging requirement, you could copy out the XML to a file at the time when the transform will run with a copy or echo task (dpending if the XML is in a variable or in a file), and then debug the XSL tranform manually using something like XML Spy or Oxygen XML editor.

HTH Joon

Joon
Hi Joon, The Issue i face with the second approach is that when I pass variables to a xslt it works fine, when I pass it via a nant script the value is not set, I dont know why and I actually dont have a way to debug it out.
Siddharth
Hi SidI would try to first output the value that you are passing into the xslt, and make sure that it is present and set correctly.Then verify that the case and variable names are exactly the same between your external debug and the nAnt script.And then finally have a look at your usage of nAnt tasks to ensure that you are using them correctly.
Joon
A: 

Hi Sid,

what you can do is break the code in pieces and then call individual to test if it is working as expected or not ?

For Ex: some logic

some logic

so what you can do is from command prompt call nant case1 or case2 .... check o/p. this way you will know which case worked as expected ... sort of debugging.

Amit