But I want to read all ChildNode's NodeValue instead of null. for example,<author>Michael</author>,so The child node is : author and the node value is: "Michael" instead of "null"... How can I achieve this? Thanks in advance...
We're not really here to do your assignments for you, but here's a hint. if (n.getNodeName()!=null&&!n.getNodeName().equals("#text")){ Ask yourself what will be the "node name" of the values you are trying to find. When you have thought about this, consider why this line might not be quite right.