Welcome to Team System Rocks Sign in | Join | Help

Enabling Process Template IntelliSense in Visual Studio 2005 using xsi:schemaLocation

Rob Caron pointed me out to an article on FTP Online by William Wen entitled "Enable IntelliSense in Your Documents" (you need to register to read the second part of the article - it's definitely worth it). In his article, William describes how you can use xsi:schemaLocation to get the XML Editor to automatically download your schema. Using his technique, I got IntelliSense to work on my process template files (although I am still searching for a technique to load them in locally).

Here are the steps I took to enable IntelliSense in my process template file (ProcessTemplate.xml):

1. Open ProcessTemplate.xml in Visual Studio 2005
2. Click on XML > Create Schema
3. Edit the newly generated ProcessTemplate.xsd schema file
4.
In the xs:schema node, add the following:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform http://www.fooserver.com/ProcessTemplate.xsd"

5. Save the file and upload it to a web server (in this example, I use a fictional server name fooserver.com). For example: http://www.fooserver.com/ProcessTemplate.xsd 

6.
Change the ProcessTemplate node in ProcessTemplate.xml to indicate the following:

<
ProcessTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform http://www.fooserver.com/ProcessTemplate.xsd">

Now whenever you load in ProcessTemplate.xml in Visual Studio 2005, you'll get IntelliSense. Not the most elegant way of enabling IntelliSense, but it works. The search continues...

Published Tuesday, August 15, 2006 6:38 PM by jldavid

Comments

# VSTS Links - 08/18/2006

Friday, August 18, 2006 8:04 AM by Team System News
Rob Caron on which version of Team Foundation Server do I have?

Joe Hummel on MSDNAA does provide...

# re: Enabling Process Template IntelliSense in Visual Studio 2005 using xsi:schemaLocation

Sunday, October 08, 2006 9:01 AM by Peter Ritchie
Seems a little easier to download the schemas you mentioned (http://msdn2.microsoft.com/en-us/library/ms194967.aspx) in one of your earlier posts, extract the XSDs locally and reference those in a noNamespaceSchemaLocation (instead of a schemaLocation, since a real namepace is not used--i.e. "http://www.w3.org/1999/XSL/Transform" is the namespace for a different scheam) attribute.  For example, if I extracted tasks.xsd to the root of C:, I could then set the following attributes on the tasks element in an XML file:
<tasks xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="file://c:/tasks.xsd">

You won't get an error in the error list about the referenced schema's targetNamespace does not match the schema location attribute, and IntelliSense will know the structure of the schema and do its stuff...
Anonymous comments are disabled