"Ouyang, Jian" <[EMAIL PROTECTED]> writes:
> Nic,
>
> If I have xml string:
>
> <tag1>
> text1
> <tag2> text2 </tag2>
> <tag2> text3 </tag2>
> </tag1>
>
> I want to display it as it shown in the browser. But if I output this xml
> string to the browser, I will get:
> text1text2text3
>
> Is this clear to you? Please help. Thanks.
Do this.
response.setContentType("text/plain");
PrintWriter out = response.getWriter();
out.println(" <tag1>\ntext1\n<tag2>text2</tag2>");
out.println(" <tag2> text3 </tag2>\n</tag1>");
out.close();
That should cause *exactly* the following to be shown in your browser:
<tag1>
text1
<tag2> text2 </tag2>
<tag2> text3 </tag2>
</tag1>
If it doesn't then you're doing something wrong /8->
Nic
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html