Get single XML element from file in Java

Hello,

I am using this to get the value of one element (value inside element):

Node m = doc.getElementsByTagName("title").item(0);

Node node = m.getChildNode();

System.out.println(node.getNodeValue());

Although it is unsuccessful as it does not compile: says that it cannot find symbol for getchildnode().

I have imported the right classes.

Is there another way of doing this or can you advise on what I have shown.

Cheers

[503 byte] By [John4938a] at [2007-11-26 17:57:12]
# 1
This is org.w3c.dom.Node? That's true, it doesn't have a getChildNode() method. You could look in the API documentation and see that. And when you do that, if you look carefully you should be able to find a method that does what you want.
DrClapa at 2007-7-9 5:10:26 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...