Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting nodename and value

843834Feb 22 2005 — edited Feb 22 2005
I have a xml file like this:

<root>
<topic id="34">
<p>Hello <b>World</b>
</topic>
[......]
</root>

I want to get all topic nodes, save the node value of topic (<p>Hello <b>World</b>) to a String. So I can print out it in HTML. Here is where Im standing right now

NodeList nodelist = doc.getElementsByTagName("topic");

But I cant manege to get all values (nodenames and values of children to topic). Need help thx.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2005
Added on Feb 22 2005
5 comments
324 views