File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes how to get the child nodes in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to get the child nodes in java" Watch "how to get the child nodes in java" New topic

how to get the child nodes in java

muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97

i have the xml like the following:

from the above xml i need the values such as block1,block2, block3 itself. how can i get it by using java.
it is very urgent... im awaiting for your response.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
How far have you gotten with this problem?

1. can you parse the source XML into a DOM?
2. have you familiarized yourself with the Java methods for manipulating a DOM? (hint - see the JavaDocs for the org.w3c.dom.Node class for an overview of what you can do with the various node types)

See the free online book by Harold for tutorials and examples close to your problem.


I agree. Here's the link:
subject: how to get the child nodes in java
It's not a secret anymore!