shannongoat
New Member
I saw the line below in code for a DOM parser at http://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/ - doc.getDocumentElement().normalize();Why do we do this normalization ? I read the docs at http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Node.html#normalize()but i could not understand a word.It says - "Puts all Text nodes in the full depth of the sub-tree underneath this Node"Okay, then can someone show me (preferably with a picture) what this tree looks like ?Can someone tell me why normalization is needed, in simple words ? What happens if we dont normalize ?