Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP outputs xml - xml parse error - page directives insert blank lines?!

 
John Brown
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm trying to output xml with this jsp page:


But the browser complains:

XML Parsing Error: xml declaration not at start of external entity
Location: http://127.0.0.1:8080/bla
Line Number 5, Column 1:
<?xml version="1.0" encoding="UTF-8"?>
^

The source of the page is:

Notice the 4 blank lines in the output? They're cause by the 4 directives I've put in the jsp:



These 4 blank lines are the cause of the xml parse error. So why do I get them in the output?

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65221
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article explains the whitespace.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic