Tools to format XML in Visual Studio 2010

10.7k Views Asked by At

Is there an XML formatter available as an add-in for Visual Studio 2010? I am currently using Notepad++ and using the XML Tools plug-in to get the formatting sorted.

Is there an add-in for VS2010, which will do something similar?

3

There are 3 best solutions below

0
On BEST ANSWER

Simply press Ctrl+E,D or use the following command from the menu:

Edit -> Advanced -> Format Document

0
On

In my version of VS 2010 it's Ctrl+K,D

or

Edit -> Format Document

1
On

Personally these days I couldn't survive without

  1. "Align Attributes each on a separate line"

Found in standard VS options :

        Tools > Options > XML > Formatting
  1. The fantastic XAML Regions Extension

Which also works for straight XML, adding the ability to create collapsible regions similar to the following (in c#) :

#region 

public void SomeMethod()
{
//...
}

#endregion