zoukankan      html  css  js  c++  java
  • 通过notepad++将混乱的xml配置的格式进行美化

    需求描述

      最近在进行hbase配置文件的修改之后,发现xml文件的格式很不美观,

      然后,在网上找了些方法,实测,通过notepad++的xml tools插件就可

      达到美化效果。

    操作过程

    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插件,需要自行进行插件的下载和安装。

    文档创建时间:2018年3月9日11:09:18

  • 相关阅读:
    重登陆模式 --ESFramework 4.0 快速上手(07)
    信息处理,分而治之-- ESFramework 使用技巧
    ESFramework 4.0 有哪些优点?
    铁血规则:事件预订与取消预订
    聊天系统Demo,增加文件传送功能(附源码)-- ESFramework 4.0 快速上手(14)
    判定生死的心跳机制 --ESFramework 4.0 快速上手(07)
    Spring中bean注入前后的一些操作:
    Spring中注入List,Set,Map,Properties
    Spring MVC视图解析器:配置多个视图解析器的优先级
    Spring 3 MVC And JSR303 @Valid Example
  • 原文地址:https://www.cnblogs.com/chuanzhang053/p/8532767.html
Copyright © 2011-2022 走看看