您好,欢迎访问一九零五行业门户网

notepad++如何把混乱的xml格式化

最近在进行hbase配置文件的修改之后,发现xml文件的格式很不美观,然后,在网上找了些方法,实测,通过notepad++的xml tools插件就可达到美化效果。
操作过程:(推荐学习:notepad++)
1.以下为原xml文件的格式效果
<configuration><property><name>hbase.rootdir</name><value>file:///root/hbase-data/hbase</value></property><property>
<name>hbase.cluster.distributed</name><value>true</value></property><property><name>hbase.zookeeper.quorum</name>
<value>redhat6,standby,hadoop3</value></property><property><name>hbase.zookeeper.property.datadir</name><value>/opt/hbase-1.3.0/tmp/zk/data</value>
</property><property><name>hbase.regionserver.wal.codec</name><value>org.apache.hadoop.hbase.regionserver.wal.indexedwaleditcodec</value></property><property>
<name>hbase.region.server.rpc.scheduler.factory.class</name><value>org.apache.hadoop.hbase.ipc.phoenixrpcschedulerfactory</value>
<description>factory to create the phoenix rpc scheduler that uses separate queues for index and metadata updates</description></property><property>
<name>hbase.rpc.controllerfactory.class</name><value>org.apache.hadoop.hbase.ipc.controller.serverrpccontrollerfactory</value>
<description>factory to create the phoenix rpc scheduler that uses separate queues for index and metadata updates</description></property></configuration>

备注:发现很不美观。
2.将以上内容放入一个文档中,点击notepad++工具顶部上的插件(p)->“xml tools”->pretty print(xml only -with line breaks)
修改后效果如下:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///root/hbase-data/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>redhat6,standby,hadoop3</value>
</property>
<property>
<name>hbase.zookeeper.property.datadir</name>
<value>/opt/hbase-1.3.0/tmp/zk/data</value>
</property>
<property>
<name>hbase.regionserver.wal.codec</name>
<value>org.apache.hadoop.hbase.regionserver.wal.indexedwaleditcodec</value>
</property>
<property>
<name>hbase.region.server.rpc.scheduler.factory.class</name>
<value>org.apache.hadoop.hbase.ipc.phoenixrpcschedulerfactory</value>
<description>factory to create the phoenix rpc scheduler that uses separate queues for index and metadata updates</description>
</property>
<property>
<name>hbase.rpc.controllerfactory.class</name>
<value>org.apache.hadoop.hbase.ipc.controller.serverrpccontrollerfactory</value>
<description>factory to create the phoenix rpc scheduler that uses separate queues for index and metadata updates</description>
</property>
</configuration>

注意:如果notepad++不存在xml tools插件,需要自行进行插件的下载和安装。
以上就是notepad++如何把混乱的xml格式化的详细内容。
其它类似信息

推荐信息