• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help!Urgent,my assignment.....

 
Mellihoney Michael
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

my servlet program

the result is:

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...
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mellihoney Michael
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
many thanks...
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic