In my xml there can be empty tags like
<name/>
The problem is that when I parse the xml, I am getting null pointer exception when I reach this line in the xml. Currently I am fetching like this:
employees.item(k).getFirstChild().getNodeValue()
How should I check tags like this in my parsing file? Please help me out.
Better to check
NULLinstead of usingtry..catchblock:Just a sample code to answer question, doesn’t make it at best performance.