最近在进行hbase配置文件的修改之后,发现xml文件的格式很不美观,然后,在网上找了些方法,实测,通过notepad++的xml tools插件就可达到美化效果。
操作过程:(推荐学习:notepad++)
1.以下为原xml文件的格式效果
<configuration><property><name>hbase.rootdir</name><value>file:///root/hbase-data/hbase</value></property><property><br/><name>hbase.cluster.distributed</name><value>true</value></property><property><name>hbase.zookeeper.quorum</name><br/><value>redhat6,standby,hadoop3</value></property><property><name>hbase.zookeeper.property.dataDir</name><value>/opt/hbase-1.3.0/tmp/zk/data</value><br/></property><property><name>hbase.regionserver.wal.codec</name><value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value></property><property><br/><name>hbase.region.server.rpc.scheduler.factory.class</name><value>org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory</value><br/><description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description></property><property><br/><name>hbase.rpc.controllerfactory.class</name><value>org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory</value><br/><description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description></property></configuration><br/>
备注:发现很不美观。
2.将以上内容放入一个文档中,点击notepad++工具顶部上的"插件(P)"->“XML Tools”->"pretty print(XML only -with line breaks)"
修改后效果如下:
<configuration><br/> <property><br/> <name>hbase.rootdir</name><br/> <value>file:///root/hbase-data/hbase</value><br/> </property><br/> <property><br/> <name>hbase.cluster.distributed</name><br/> <value>true</value><br/> </property><br/> <property><br/> <name>hbase.zookeeper.quorum</name><br/> <value>redhat6,standby,hadoop3</value><br/> </property><br/> <property><br/> <name>hbase.zookeeper.property.dataDir</name><br/> <value>/opt/hbase-1.3.0/tmp/zk/data</value><br/> </property><br/> <property><br/> <name>hbase.regionserver.wal.codec</name><br/> <value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value><br/> </property><br/> <property><br/> <name>hbase.region.server.rpc.scheduler.factory.class</name><br/> <value>org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory</value><br/> <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description><br/> </property><br/> <property><br/> <name>hbase.rpc.controllerfactory.class</name><br/> <value>org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory</value><br/> <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description><br/> </property><br/></configuration><br/>
注意:如果notepad++不存在XML Tools插件,需要自行进行插件的下载和安装。
以上就是notepad++如何把混乱的xml格式化的详细内容,更多请关注php中文网其它相关文章!
Notepad++是一款专为程序员设计的高效文本编辑器,是编程工作中不可或缺的工具。Notepad++支持多达27种编程语言,包括但不限于C、C++、Java、C#、XML、HTML、PHP和JavaScript等,有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号