XML Document Validation with an XML Schema
Subject:   org.xml.sax.SAXParseException: Document root element is missing
Date:   2008-09-07 22:56:30
From:   Iruu
I have a java file in which i parse a xml file

URL url = new URL(address);
con = (HttpURLConnection)(url.openConnection());
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(in);

Error occurs in the last line only for some xml files.
the xml files are well formed and is downloaded from google so no error can be in that ,
what may the reason for the error.
the error is as follows
org.xml.sax.SAXParseException: Document root element is missing
at org.apache.crimson.parser.Parser2.fatal(
at org.apache.crimson.parser.Parser2.fatal(
at org.apache.crimson.parser.Parser2.parseInternal(
at org.apache.crimson.parser.Parser2.parse(
at org.apache.crimson.parser.XMLReaderImpl.parse(
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(
at javax.xml.parsers.DocumentBuilder.parse(
at com.df.semtools.adwords.GetAdwordsStats.getKeywords(
Thanks for ur help in advance