Parsing error, line 1, uri null
Hi ,
I have a program which is using DocumentBuilder to parse an xml.The program is working fine when a parse a simple xml file which is stored in my local system.I would like to know is there any way to parse the xml which i am getting from response.Here is the program to get xml response
URL url = new URL(strUrl);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("Msg=" + strHtml);
out.close();
BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));
String inputLine;
String xmlReturned = "";
while ((inputLine = in.readLine()) != null){
System.out.println(inputLine);
xmlReturned = xmlReturned + inputLine;
}
This is the parser code i am using
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(connection.getInputStream());
But i am getting an error Parsing error, line 1, uri null if i run this code

