My client has decided to introduce null tags in the incoming xml strings
while i parse the document with null tags and try to get the value it gives me a null pointer
eg:"
<SearchName><Last>kalidoss</Last><First/></SearchName>
if(search.getNodeName().equalsIgnoreCase("First"))
{
String first=search.getFirstChild().getNodeValue();
System.out.println("The value of first is"+first);
}
}
it goes into the if loop, but the node "search" is a null node
is there any way i can avoid this??? other than catching it in a try catch block for null pointers???