I'm debugging a transform with Visual Studio. The application that uses the transform normally also passes in some parameters:
XslTransform xslTransform = new XslTransform();
xslTransform.Load(myXslt);
XsltArgumentList transformArgumentList = new XsltArgumentList();
transformArgumentList.AddParam(paramName1, String.Empty, paramValue1); // this
transformArgumentList.AddParam(paramName2, String.Empty, paramValue2); // and this
xslTransform.Transform(inputStream, transformArgumentList, outputStream);
How can I set the parameters when debugging?
You should use the following XslCompiledTransform constructor:
with the
enableDebug
argument set totrue
.Then you can start debugging and the debugger will stop on breakpoints set in your XSLT transformation.
Here is an example:
Of course, if you are lazy, you may just hardcode the values of the parameters in your XSLT stylesheet: