在Visual Studio 2010中格式化XML的工具

时间:2023-01-14 22:30:08

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.

是否有XML格式化程序作为Visual Studio 2010的外接程序?我目前正在使用Notepad++,并使用XML Tools插件对格式进行排序。

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

VS2010是否有一个附加组件,它会做类似的事情?

3 个解决方案

#1


19  

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

只需按Ctrl+E,D或使用菜单中的以下命令:

Edit -> Advanced -> Format Document

编辑->高级->格式文件

#2


2  

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

在我的VS 2010版本中是Ctrl+K,D

or

Edit -> Format Document

编辑- >格式文档

#3


1  

Personally these days I couldn't survive without

就我个人而言,这些天我离不开它

  1. "Align Attributes each on a separate line"
  2. 将属性对齐到单独的一行上

Found in standard VS options :

标准VS选项:

        Tools > Options > XML > Formatting
  1. The fantastic XAML Regions Extension
  2. 神奇的XAML区域扩展

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

这也适用于直接XML,增加了创建可折叠区域的能力(在c#中):

#region 

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

#endregion 

#1


19  

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

只需按Ctrl+E,D或使用菜单中的以下命令:

Edit -> Advanced -> Format Document

编辑->高级->格式文件

#2


2  

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

在我的VS 2010版本中是Ctrl+K,D

or

Edit -> Format Document

编辑- >格式文档

#3


1  

Personally these days I couldn't survive without

就我个人而言,这些天我离不开它

  1. "Align Attributes each on a separate line"
  2. 将属性对齐到单独的一行上

Found in standard VS options :

标准VS选项:

        Tools > Options > XML > Formatting
  1. The fantastic XAML Regions Extension
  2. 神奇的XAML区域扩展

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

这也适用于直接XML,增加了创建可折叠区域的能力(在c#中):

#region 

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

#endregion