Problem in displaying xml data in text area

my code is

resp.setContentType("text/html");

PrintWriter out = resp.getWriter();

String result = SimulatorProcesser.putMessage("",req.getParameter("in"));

out.println("<textarea>"+result+" </textarea>");

but it is giving out put as

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

--

Only one top level element is allowed in an XML document. Error processing resource 'http://localhost:9080/TESTAPI/TestServ...

<textarea><?xml version="1.0"?><Exception><ErrorCode>9999</ErrorCode><ErrorMessage>null&...

Kinldy help me ...thanks in advance

[776 byte] By [Vjay_javaa] at [2007-11-27 4:51:04]
# 1

Do you want to view unparsed xml in the textarea? You have to replace at least the HTML entities < and > by & lt; and & gt;, so that they don't get parsed inside the HTML structure. Here is an overview of those entities: http://www.w3schools.com/tags/ref_entities.asp

You can use String#replaceAll() for this.

BalusCa at 2007-7-12 10:04:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...