Intellisense in onet.xml
In the Schema-field, clikc the three dots to browse for a schema file. Find the wss.xsd-file, usually located in ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML’ and click add. That’s it, Visual Studio should now give you intellisense. Test this by placing the cursor at the very beginning of the file and press CTRL+Space. You should see a drop-down such as this:
Now, to tell Visual Studio to use the correct xsd-file (wss.xsd) every time you create an onet.xml-file you need to link an xml-namespace to the wss.xsd file. To do this you need to create one more xml file and also remember to use the correct namespace for your onet.xml files.
First, create a new XML-file in C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas. Call it whatever you like, for instance SharePointCatalog.xml. Open the file and paste in the following:
href="C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/XML/wss.xsd"
What this actually does is link the ‘targetNamespace‘ with the schema located in ‘href‘. You can use the same technique to link your own schema to any namespace if you use those.
Now, to get Visula Studio to use the intellisense with the schema, add the namespace attribute to the root elemet of your XML file, for instance:
If you now hit CTRL+Space you should get intellisense.
Found this article valuable? Want to show your appreciation? Here are some options:
a) Click on the banners anywhere on the site to visit my blog's sponsors. They are all hand-picked and are selected based on providing great products and services to the SharePoint community.
b) Donate Bitcoins! I love Bitcoins, and you can donate if you'd like by clicking the button below.
c) Spread the word! Below, you should find links to sharing this article on your favorite social media sites. I'm an attention junkie, so sharing is caring in my book!