prob in loading xml

hi,

I am facing prob via loading xml file .i am creating dis file in jsp in scripletts “<% %>”

Wen i call “loadXML()” API from " gridDemo.jsp" , d control goes 2 “Process.jsp " but den it gives me alert like



error type-load xml

description- incorrect xml



and no exception is generated during dis procedure

Here is my src code.

=========================================================================

gridDemo.jsp



====================================================================

<%@ page language=“java” contentType=“text/html; charset=ISO-8859-1”

pageEncoding=“ISO-8859-1”%>























Grid Demo





















/// end of jsp====================================



Process.jsp

========================================================================





<%@ page language=“java” contentType=“text/xml; charset=ISO-8859-1”

pageEncoding=“ISO-8859-1”%>



<%@page import=“java.io.PrintWriter”%>

<%@page import=“java.io.OutputStream”%>



<%

//set content type and xml tag

int totalCount=1000;

int posStart=1;

try{



OutputStream outStream=response.getOutputStream();

PrintWriter printWriter=new PrintWriter(outStream, true);

printWriter.flush();

out.clear();



out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");

out.println("");

out.println("<row id=“1”>");

out.println("");

out.println(“Hello”); // value for product name

out.println("");

out.println("");

out.println(“type1”); // value for type

out.println("");

out.println("");

out.println(“40”); // value for price

out.println("");

out.println("");



out.write("");



}

catch(Exception e)

{

    e.printStackTrace();

}

%>





The reasons of “Incorrect xml” error could be:
*XML data is invalid ( invalid structure of XML );
if some kind of server side error occurs, error or debug output may break valid xml data;
*invalid content type ( must be a text/xml for XML data );
*whitespaces before <?xml output;
*not escaped special characters, such as &, <, >;
*incorrect encoding of data.

Solution:
*use debug version of dhtmlxcommon.js , which will show extended error info;
*load the same URL in separate browser window - it will show reason and location of error;
*correctly escape special characters in XML data.