4
votes

I want to debug a xslt used in umbraco (4.0) user control. The xslt is using static .net methods from an assembly say MyAssembly. The xslExtensions.config has been setup with the following entry <ext assembly="/bin/MyAssembly" type="MyAssembly.Utility" alias="MyAssembly.Utility" />

This is referenced and used in the xslt file like

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:MyAssembly.Utility="urn:MyAssembly.Utility"....
-------------------------------------------------->

--------------------------------------------------
<xsl:variable name="Id" select="MyAssembly.Utility:GetQueryStringValue('tlid')"></xsl:variable>

The assembly is copied in the bin folder of the application

The xslt file is quite big and extensively using .net methods. I'm just wondering how can I debug the XSLT by adding breakpoints at various lines. If I run the application just like any .net application and put break points then these breakpoints don't get a hit. If I use the XSLT debug options from the Visual studio menu i.e. Start XSLT Debugging then the debugging starts but I get the error on this line <xsl:variable name="Id" select="MyAssembly.Utility:GetQueryStringValue('tlid')"></xsl:variable>

the error is "Cannot find a script or an extension object associated with namespace 'urn:MyAssembly.Utility'."

Any ideas how can we debug the xslt as explained in this MS visual studio walk-through https://msdn.microsoft.com/en-us/library/ms255602.aspx using .net methods?

1

1 Answers

0
votes

I have never used XSLT so i'm probably not going to help with what I'm going to say, but since I've been doing this since day 1 why don't you use break points in Visual Studio to see what your code does? That's the only way I've needed so far in debugging my code.