views:

169

answers:

3

I have an XML file which in addition to it's standard XML schema allows the use of XSLT.

I am including the correct namespace for XSLT (xmlns:xsl="http://www.w3.org/1999/XSL/Transform") however I am not receiving Intellisense for XSLT when I start typing xsl: tags.

Is it possible to turn this on? When I edit XSLT files it works absolutely fine.

+1  A: 

XSLT Intellisense is a hidden feature of VS 2008. It has to be enabled by setting a Registry key (http://memoryleak.me.uk/2008/11/xslt-intellisense-in-visual-studio-2008.html):

First, make sure you have the xslt.xsd file in the C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas folder. If not, copy it from VS2005.

Next, add a new string value to the registry named XsltIntellisense under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\XmlEditor and set the value to True. This will enable some other nice features to the standard tag completion stuff.

This hint came originally from http://www.tkachenko.com/blog/archives/000740.html

0xA3
Sounds like a nice feature sadly it doesn't seem to work.
AnthonyWJones
I tried it once some time ago and then it worked, although the benefit didn't seem to be too much. Maybe it's no longer working since SP1...
0xA3
+2  A: 

The Xml editor does support the standard xsl intellisense but it will strictly apply the schema. Hence you first need to enter a <xsl:stylesheet> and start adding children to it before you will see any xsl options. This is because all other other xsl elements need be children of either the xsl:stylesheet element or some other xsl element.

AnthonyWJones
Makes sense, if I were to define a schema for my XML document which specified xsl:choose for example being available within certain tags would that be allowed?
Craig Bovis
@Craig: Dunno, never tried, have a go and let us know the results.
AnthonyWJones
A: 

I tried in VS 2010 to do this too - but it seems that it does not work. Does anyone know a way to do the same in VS 2010?

Netsi1964