怎么没有人给点指点呢!?高手哪里去了??
maybe并不需要多高,只要能解决此问题啊。

解决方案 »

  1.   

    不奇怪,xml设计的就是这样的。
      

  2.   

    The normalize() method descends the tree from the given node and merges all adjacent text nodes. Empty text nodes are deleted.
      

  3.   

    是啊,我就是看了这个解释,才用这个方法的。但是我发现doc1.nornalize();之后还是得到的7个node.
    照它的解释,那就应该是3个了啊。
      

  4.   

    呵呵,关键是解析器并没有把元素间的空白看作可normalize()的对象啊。 
    <root>
    <a/>
    </root>
    此时root无论是否normalize()都有3个child node。如果使用DOM为root添加一text node:
    Text text=doc.createTextNode("");
    root.appendChild(text);不使用/使用normalize()时root的child node数为4/3。