次の方法で共有


Stylesheet import tree in the XSLT Debugger

Complex XSLT stylesheets often contain several include and/or imports instructions. VS XML Editor has very limited support for such scenarios. (Most noticeable it lacks the concept of "primary stylesheet".)

 

In the XSLT Debugging session you may need to put breakpoint in the template that is defined in one of the referenced files and VS doesn't provide convenient way of opening these files.

Even more tricky is putting breakpoint on the built-in template rule. There is no way to find and open them in the VS.

 

VS 2008 SP1 has a solution for this problem but unfortunately it is not enabled by default. I hope VS 2010 would fix this.

This feature can be enabled by setting to 'True' the registry key 'XsltImportTree' under 'HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\XmlEditor'.

With this feature each time you start XSLT Debugger the XSLT import/include tree would be added to the solution explorer. To see it you need to have "Solution Explorer" tool window opened (View | Solution Explorer).

 

This is a sample screen XSLT Debugger in of VS 2009 SP with the feature enabled:

debugger screenshot

I hope you would find this useful.

(See also https://www.tkachenko.com/blog/archives/000740.html)

 

Sergey Dubinets

Comments

  • Anonymous
    May 19, 2009
    PingBack from http://asp-net-hosting.simplynetdev.com/stylesheet-import-tree-in-the-xslt-debugger/

  • Anonymous
    May 20, 2009
    Hi Sergey, Do you know of any reason why this behavior isn't enabled by default. I mean there must be a reason even though it might just be, lack of testing.

  • Anonymous
    May 20, 2009
    The official reason is luck of time to test the feature. Technically there is not a lot to test there. Hierarchy is created with every XSLT Debugger session no matter what. Its primary use resolve paths of locally cached http stylesheets to the original URIs. (PDB doesn’t allow http/ftp paths). The only thing reg key controls is flag __VSADDVPFLAGS.ADDVP_AddToProjectWindow when the hierarchy is added to solution by AddVirtualProject(). The same time this is not fully backed feature. We didn’t spend any time thinking about UI (Icons, title, …). The big open question is what to do at design time? We need an analog of Schema Explorer aka XSLT Explorer. So don’t afraid to use it.