I've got a section of XML that looks like this:
<entry>
<id>tag:example.com,2005:Release/343597</id>
<published>2012-04-10T11:29:19Z</published>
<updated>2012-04-10T12:04:41Z</updated>
<link type="text/html" href="http://example.com/projects/example1" rel="alternate"/>
<title>example1</title>
</entry>
I need to grab the link http://example.com/projects/example1
from this block. I'm not sure how to do this. To get the title of the project I use this code:
String title1 = children.item(9).getFirstChild().getNodeValue();
where children
is the getChildNodes()
object for the <entry> </entry>
block. But I keep getting NullPointerExceptions
when I try to get the node value for the <link>
node in a similar way. I see that the XML code is different for the <link>
node, and I'm not sure what it's value is.... Please advise!