This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Your assumption about how the DOM tree is structured is incorrect. You may want to print out the type and name of the node you're inspecting.
Joined: Aug 29, 2009
I hope this would be correct structure:
Please let me know what I am missing here:
Joined: Mar 22, 2005
That's the XML structure; but the DOM tree structure is different than what you think it is. I suggest you iterate through the entire node list and print out node names, types and values. You should also consult the javadocs of the Node interface in order to learn what values nodes have for the various node types.