I am trying to parse through a document using a DOM Parser in java.
For the following line of code--
Element docEle = dom.getDocumentElement();
I am getting the following error message--
2011-10-06 05:03:19,944 ERROR AWT-EventQueue-0 XMLDOMParser.class - Full error Stack Trace=java.lang.NullPointerException
at com.arvind.googlepatentsdata.XMLDOMParser.parseDocument(XMLDOMParser.java:290)
As I understand, this error occurs whenever the document itself is empty... Is there some way to check (before the dom element is obtained) if the document is empty or not... So that if it is empty then I will not do any further processing and move on to the next file?