<?xml version="1.0" encoding="gb2312"?>
<threads>
   <thread>
      <title>我是</title>
      <author>大大</author>
      <content>飞交换机</content>
   </thread>
<thread><title>1111</title><author>111111</author><content>111111111</content></thread>
<thread><title>11111111111111111111</title><author>1111111111</author><content>11111111111111111111</content></thread>
<thread><title>11111</title><author>111111</author><content>111</content></thread>
</threads>
这是我用PHP动态修改后的XML文件,排版格式比较乱,有什么办法能把XML文件格式排版整理好?

解决方案 »

  1.   

    可以用eclipse,建立一个xml文件,直接使用格式化代码的命令来整理(Ctrl+Shift+F)来处理就可以了因为经常要处理xml,我现在是用Altova XMLSpy
    也可以自动识别和整理代码,而且栅格显示很方便修改eclipse整理后如下:<?xml version="1.0" encoding="gb2312"?>
    <threads>
    <thread>
    <title>我是</title>
    <author>大大</author>
    <content>飞交换机</content>
    </thread>
    <thread>
    <title>1111</title>
    <author>111111</author>
    <content>111111111</content>
    </thread>
    <thread>
    <title>11111111111111111111</title>
    <author>1111111111</author>
    <content>11111111111111111111</content>
    </thread>
    <thread>
    <title>11111</title>
    <author>111111</author>
    <content>111</content>
    </thread>
    </threads>
      

  2.   

    http://bbs.ctex.org/viewthread.php?tid=45278Notepad配置格式可以不。