Click here to Skip to main content
13,250,883 members (49,680 online)
Click here to Skip to main content
Add your own
alternative version


56 bookmarked
Posted 27 Jan 2003

XSLT Transformations and XSLT Intellisense within the .NET IDE

, 28 Jan 2003
Rate this:
Please Sign up or sign in to vote.
Demonstrates the implementation of XSLT Intellisense in Visual Studio .NET using macros


With XML and XSLT transformations becoming a large part of many business applications it would be beneficial to have this functionality in the Visual Studio .NET IDE. Following are the instructions for adding XSLT transformations and Intellisense to XSLT documents to the Visual Studio .NET IDE.

This additional functionality is achieved by implementing a macro written in VB.NET and a schema that depicts the hierarchical relationship of the XSLT syntax. The first section gives instructions on how to load the macro into a demo project and transform some sample XSLT against a sample xml file. The second section gives detailed instructions on what to do with the included xsd file to get intellisense when working with XSLT documents.

Loading and Using the Macro

  1. Creating a demo project:

    Open the .NET IDE and select a console application with the name of MyXsltSample. For simplicity we will use a console application to demonstrate this new functionality, however you could use any type of project you desire.

  2. Navigate to the Tools->Macros->Load Macro Project menu item as shown above and open the macro project included in the zip file called XsltFunctions.

  3. You should now see a macro project in your macro explorer named XsltFunctions as shown above with a child node named xsltTransform. The macro is now ready to run by double clicking the xsltTransform node, however we must add an XSLT file to the project so we have something to transform.

  4. Navigate to the .NET solution explorer and right click on the project to get the menu shown above and select Add Existing Item. Next select the XSLT file included in the zip file named sampleXslt.xslt this will add the file to the current project.

  5. Finally, navigate to the Macro Explorer again (as shown above) and double click on the XslTransform node this will bring up a file dialog box. You need to select an xml source document for the transformation, for this demo navigate to the included file named sample.xml and click open. If all went well you should now see a new window in the IDE with the newly transformed xml document.

Adding xslt Intellisense to Visual Studio .NET

Now that we know we can transform XSLT documents inside the Visual Studio .NET IDE it would be nice to get Intellisense when working with XSLT documents.

The schema required to achieve this functionality was originally developed by the people at and more information can be found there in regards to this functionality.

The zip file is outlined at the top of this article please refer to that section for a description of which files relate to part one of the article and which files relate to part two. The following steps outlined come directly from the ReadMe.txt file in this directory.

  1. Locate your Microsoft Visual Studio .NET installation folder. (The default location is Program Files\Microsoft Visual Studio .NET)
  2. Place the XSD files in the Common7\Packages\schemas\xml directory.
  3. The following step is optional, the only difference is for people who prefer the XSLT template to contain the xsl: prefixes, you will need to modify the XSLT files that ship with Visual Studio .NET.
  4. Place the XSLT file in the Common7\IDE\NewFileItems directory. This will also fix the existing stylesheet (it was missing the xsl prefix). A backup has been provided with the zip file.
  5. You may also have to go find two other locations that the XSLT file may be placed:
    1. If you have VB.NET installed, you will need to also replace the XSLT file in the Vb7\VBWizards\XSLTFile\Templates\xxxx folder. xxxx being any numbered folder, 1033 is the us folder and so on. If you have multiple folders, you will need to replace the item in each of those folders.
    2. If you have C# installed, you will need to also replace the XSLT file in the VC#\CSharpProjectItems folder.

Now when you add an XSLT file to a project as we did in the beginning of this article and you begin to type your XSLT statements you will see Intellisense drop downs appear as shown below:


In summary the Visual Studio .NET IDE is very extendable via macros and schemas if you use them to their fullest potential. This article was intended to demonstrate how easy it is to add needed functionality like XSLT transformations to the Visual Studio .NET IDE. A logical next step would be to make the macro into an add-in to allow for added features like enhanced UI for a better user experience.


  • First revision - 28th January, 2003.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Doug Doedens
United States United States
Doug Doedens is a senior software architect specializing in consulting on enterprise applications and is living in San Diego.

You may also be interested in...

Comments and Discussions

GeneralThe W3C and XML Pin
Heath Stewart19-Feb-03 3:12
editorHeath Stewart19-Feb-03 3:12 
GeneralRe: The W3C and XML Pin
Doug Doedens19-Feb-03 10:19
memberDoug Doedens19-Feb-03 10:19 
GeneralRe: The W3C and XML Pin
Heath Stewart19-Feb-03 11:25
editorHeath Stewart19-Feb-03 11:25 
GeneralVery useful Pin
DmitriyZ4-Feb-03 4:33
memberDmitriyZ4-Feb-03 4:33 
GeneralRe: Very useful Pin
Anna-Jayne Metcalfe4-Feb-03 5:00
memberAnna-Jayne Metcalfe4-Feb-03 5:00 
GeneralRe: Very useful Pin
Loki3-Apr-03 19:17
memberLoki3-Apr-03 19:17 
GeneralRe: Very useful Pin
Anna-Jayne Metcalfe3-Apr-03 20:22
memberAnna-Jayne Metcalfe3-Apr-03 20:22 
Generalawesome stuff Pin
.S.Rod.28-Jan-03 20:00
member.S.Rod.28-Jan-03 20:00 
GeneralRe: awesome stuff Pin
Paul Selormey28-Jan-03 21:48
memberPaul Selormey28-Jan-03 21:48 
GeneralRe: awesome stuff Pin
.S.Rod.28-Jan-03 22:02
member.S.Rod.28-Jan-03 22:02 
GeneralRe: awesome stuff Pin
Paul Selormey28-Jan-03 22:51
memberPaul Selormey28-Jan-03 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171114.1 | Last Updated 29 Jan 2003
Article Copyright 2003 by Doug Doedens
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid