I get an error parsing xslt on certain conditions, the xslt is saved fine and does get any error when i visualize it. When I run it with umbdebugshowtrace=1 there's no red error message lines either.
Any suggestions on how to debug this one? I'm about to go disabling piece by pice of the xslt to find out what goes wrong here.
Sadly, debugging xslt can be a challenge. You've done all the obvious stuff so now you need to disable parts or add debugging output.
If I were to guess, you may be looking for a property that doesn't exist in some situations and that's why it is failing. Use the string() function around your if statements and xpath selectors to avoid this problem. By casting to a string you won't have problems that could be handled by Exists, IsSet, IsNull, etc. in other languages... it'll just contain and empty string or the value of the property.
You see this all the time in the sample xslt templates for checking the umbracoNaviHide property, for instance.
This one is always difficult to debug. I usually first check if I have any xslt-extensions in my xslt-file, and then try to outcomment those if there are any. If you open your file in Visual Studio, there will also be some help with your syntax, missing templates etc., but those kind of errors should be caught by Umbraco, if you saved your file in the backend.
You could also try out the XSLT visualizer in the developer-section in Umbraco backend, maybe you can find something interesting in here.
Otherwise, I think that you should disable the file piece by piece, like you also suggested yourself.
I found the error. :-) It was in a inline .net-code, that was addressing a property I hade removed from the document type. Dooh. Need to remember to add more error handling / in my own code.
But - about the missing red lines. Would they be missing even if the error was in a xslt-extension?
"Casting to a string", ok I'll definitely keep that advice for my further xslt-adventures.
Debugging Xslt files can be very easy. There's a very simple trick I learned at the Benelux meetup. All you need to do is open the xslt file in Visual studio (works even on a new instance) and attach the debugger to your Umbraco website (w3wp.exe). Make a breakpoint and when you load the page containing the xslt file the breakpoint is hit and you can debug your xslt file the same way you can with a user control.
Error parsing xslt, but no error message.
Hi!
I get an error parsing xslt on certain conditions, the xslt is saved fine and does get any error when i visualize it. When I run it with umbdebugshowtrace=1 there's no red error message lines either.
Any suggestions on how to debug this one? I'm about to go disabling piece by pice of the xslt to find out what goes wrong here.
Regards
Jonas
Sadly, debugging xslt can be a challenge. You've done all the obvious stuff so now you need to disable parts or add debugging output.
If I were to guess, you may be looking for a property that doesn't exist in some situations and that's why it is failing. Use the string() function around your if statements and xpath selectors to avoid this problem. By casting to a string you won't have problems that could be handled by Exists, IsSet, IsNull, etc. in other languages... it'll just contain and empty string or the value of the property.
You see this all the time in the sample xslt templates for checking the umbracoNaviHide property, for instance.
Let us know what you find out.
cheers,
doug.
This one is always difficult to debug. I usually first check if I have any xslt-extensions in my xslt-file, and then try to outcomment those if there are any. If you open your file in Visual Studio, there will also be some help with your syntax, missing templates etc., but those kind of errors should be caught by Umbraco, if you saved your file in the backend.
You could also try out the XSLT visualizer in the developer-section in Umbraco backend, maybe you can find something interesting in here.
Otherwise, I think that you should disable the file piece by piece, like you also suggested yourself.
Hope you'll find the error.
/Kim A
Yes, thank you both for your advice.
I found the error. :-) It was in a inline .net-code, that was addressing a property I hade removed from the document type. Dooh. Need to remember to add more error handling / in my own code.
But - about the missing red lines. Would they be missing even if the error was in a xslt-extension?
"Casting to a string", ok I'll definitely keep that advice for my further xslt-adventures.
Regards
Jonas
Debugging Xslt files can be very easy. There's a very simple trick I learned at the Benelux meetup. All you need to do is open the xslt file in Visual studio (works even on a new instance) and attach the debugger to your Umbraco website (w3wp.exe). Make a breakpoint and when you load the page containing the xslt file the breakpoint is hit and you can debug your xslt file the same way you can with a user control.
is working on a reply...