Intellisense in XSLT
If you are using Visual Studio 2008 for XSLT development you will no doubt be familiar with the intellisense/autocomplete option for XSLT schema elements. For instance, when you type say <xsl: you will notice the intellisense dropdown that displays as shown in figure A. However, the limitation here is that when you get to actually using templates, attributes or params, defined in the xslt, intellisense does not kick in (see figure B)
Figure A: Intellisense for XSLT schema element
Figure B: Intellisense does not appear for template name
Here is an undocumented feature of Visual Studio 2008 that now allows you to use intellisense for XSLT defined templates, attributes and params.
Intellisense for template names
Intellisense for param names
Applying the Registry Hack to enable expanded Intellisense
Here is how you can enable this feature. Now, since the below procedure involves modifying the registry, the standard cautionary note of backing up registry, and potential negative impact direct registry editing can have on your PC applies. Refer the article How to back up and restore the registry in Windows.
Now that you know what you are doing, do this -
- Start regedit
- Navigate to HKEY_CURRENT_USER\Software\Microsoft\Visual Studio\9.0\XmlEditor
- Create a new String Value.
- Set the key name as “XsltIntellisense” (without the quotes)
- Set the value as “True” (without quotes).
Close are relaunch Visual Studio 2008 to swing the new and expanded intellisense into action.
There is a good reason this feature is undocumented – it has bugs.
I have noticed quite a few occasions where the intellisense suggestions do not reflect the latest changes. The only way to fix this appear to be closing the document and opening it again. This can be pretty annoying when you are creating an xslt from scratch.
Give it a spin.
If you don't like it, or if its too buggy for you then you can toggle the value of the registry key to False, or delete it to get back to the original RTM intellisense behavior.