I have been trying to modify the following code in JSP from here:
ArrayList arrayList=new ArrayList();
String = "tagToFind";
Node n = node.getParentNode();
String printOut = "";
while (n != null && !n.getNodeName().equals(tagToFind)) {
n = n.getParentNode();
}
if (n.getNodeValue() != null){
arrayList.add(n.getNodeValue());
}
on the "if (n.getNodeValue() != null){" line I get a "NullPointerException" error. I don't understand why I'm getting that error as I'm trying to test for Nulls and skip them.
Can anyone help me over come this issue?