This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet and file for ie  RSS feed

 
Zhining Zhang
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I have a html file like test.html
====================
<?xml version="1.0" encoding="UTF-8"?>
<H1>XSL</H1><H2>John Smith22</H2>
=====================
Using IE open the file, URL is d:\mytest\test.html. It looks fine.
But if URL is http://localhost:8080/testwebapp/test.html.
i got the error
===================
Only one top level element is allowed in an XML document. Line 2, Position 14

<H1>XSL</H1><H2>John Smith</H2>
=====================
Any idea?
Thanks!
-Zhining
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I'm surprised it worked at all... What are you trying to write, HTML or XML? The rules are different for each...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you open the file locally,
IE uses its extension to display the file
(Save the file as test.gif and see what happens).

but if it is coming from the server, it is content type of the file that matters. And Since your file is not a valid XML, IE is giving the error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!