simple XML parsing problem
In the code below im trying to see what is in the text node for a bookmark. Instead of getting the contents of the node i get nothing. Help ?
- - - my XML document - - -
<?xml version="1.0"?>
<!DOCTYPE folder SYSTEM "bookmark.dtd">
<folder name="Travel Sites">
<folder name="Islands">
<bookmark title="Seychelles" url="seychelles.net">Fun in the sun</bookmark>
</folder>
<bookmark title="Kashmir" url="kashmir.com">Lakes</bookmark>
</folder>
- - - code snippet - - -
NodeList children = root.getChildNodes();
System.out.println("num child nodes: " + children.getLength());
for (int i = 0; i < children.getLength(); i++) {
if (children.item(i).getNodeType() == Node.TEXT_NODE) {
System.out.println("node contents: " + children.item(i).getNodeValue());
}
}
- - - output - - -
node contents:
node contents:
node contents:

