Share on Facebook
Welcome to MSDN Blogs Sign in | Join | Help

Cool Visual Studio 2005 Feature: Snippets and Document Inference

I love learning new featuresof Visual Studio.  Today, I saw an email from Chris Lovett where he showed a feature of snippets that I had no idea existed.  Intellisense in an XML document will actually create an XML document inferred from an associated schema.

Start with an XML schema.  Here, I created a simple complex type "TN" and created an element "PhoneNumber" using that type.

Create a new XML document.  In the Properties pane for the document (hit F4 while in the document editor to pull up the properties), associate the document with the schema that you just created. 

Click on the ellipsis button and that will pull up a window that lets you choose from schemas in the project or in the schema cache.

 Once you associate the XML document with your schema, go back to the editor for the XML document. As expected, when you type the first angle bracket, you get an Intellisense dropdown according to the schema. That's not the cool part yet...

The cool part is that you can select the node, then hit "TAB TAB" and it will stub out an XML document based on the schema that you just created with the capability of code snippets-like fill-ins for the values.

Published Monday, February 20, 2006 1:04 PM by kaevans

Comments

# Those XML Features Are in VS2005, You Don't Have to Wait for Orcas!

Friday, April 06, 2007 10:26 AM by Kirk Allen Evans' Blog

InfoQ posts about 5 short demos on features you will find in Orcas . Glad to see some buzz being generated

# XML Editing Tools in Visual Studio

Thursday, August 16, 2007 9:18 AM by Joe On .NET

XML Editing Tools in Visual Studio

# XML Editing Tools in Visual Studio

Thursday, August 16, 2007 9:18 AM by Joe On ASP.NET

RIAs mean passing data around and XML is one of the big flavors for doing this. The XML editing tools

# XML Editing Tools in Visual Studio

Thursday, August 16, 2007 9:18 AM by Joe Stagner - Frustrated by Design !

RIAs mean passing data around and XML is one of the big flavors for doing this. The XML editing tools

# XML Editing Tools in Visual Studio

Thursday, August 16, 2007 9:30 AM by Noticias externas

RIAs mean passing data around and XML is one of the big flavors for doing this. The XML editing tools

# MSDN Blog Postings » XML Editing Tools in Visual Studio

Thursday, August 16, 2007 9:41 AM by MSDN Blog Postings » XML Editing Tools in Visual Studio

# MSDN Blog Postings » XML Editing Tools in Visual Studio

Thursday, August 16, 2007 9:41 AM by MSDN Blog Postings » XML Editing Tools in Visual Studio
New Comments to this post are disabled
 
Page view tracker