This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
in the inner most loop of your code, you got to the point where you can print the node name. For example, "title" <title>Open source or no: Let the market decide</title> The node you are examining at this point has a node name "title" and node value "null". I assume you are trying to print the text "Open source....". It is represented by the child node and this child node has a node name "#text" (or null for some parsers) and the node value "Open source..." To get your program working, get the child node, check it's Node type (Node.TEXT_NODE) and then get the NodeValue.
<a href="http://www.mqtips.com" target="_blank" rel="nofollow">MQMessenger</a> - free Java app for MQSeries
Joined: Sep 14, 2002
Perfect, thank you! This is my final code:
Joined: Jul 21, 2003
you can remove a lot of lines from your code using the call getElementsByTagName("tag_name"). I use this function to get the value of a node:
the 'for' loop inside is just to be safe with all sorts of parser implementations. The text value of the node is represented, some times, in multiple child nodes.