aspose file tools*
The moose likes JSP and the fly likes JSP outputs xml - xml parse error - page directives insert blank lines?! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP outputs xml - xml parse error - page directives insert blank lines?!" Watch "JSP outputs xml - xml parse error - page directives insert blank lines?!" New topic
Author

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

John Brown
Ranch Hand

Joined: Dec 01, 2004
Posts: 35
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

Joined: Jan 10, 2002
Posts: 61224
    
  66

This article explains the whitespace.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP outputs xml - xml parse error - page directives insert blank lines?!