• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Content is not allowed in prolog.

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.fop.apps.Driver.render(Driver.java:424)
at org.apache.fop.apps.Driver.run(Driver.java:508)
at com.portal.PDFWriter.printDocument(PDFWriter.java:83)
at com.portal.PDFWriter.<init>(PDFWriter.java:32)
at com.portal.PDFWriter.main(PDFWriter.java:93)

can anybody suggest why we get the above
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably the start of your document is not clean - perhaps an extra character or two accidently got in. You should be able to extract the line and column it is objecting to from the SAXException.
Bill
[ November 05, 2004: Message edited by: William Brogden ]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
William is right.
Actually I faced such a problem when I had saved an xml document's specific parts from within Windows Notepad into UltraEdit (via CTRL-C CTRL-V) The 1st hexadecimal numbers are: FFFE 3C00 3F00 7800 6D00 6C00 which maps to FFFE<?xml By the way FFFE: means Unicode UTF-8 Big Endian Encoding .
Actually nothing was wrong. I donot figure out WHY but it is so.. then I chose DOS Schema and could process the files.
[ February 18, 2005: Message edited by: R�stem-� Zal� ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont have access to UNIX system, cant test if my xml file has those special characters before the prolog.

but heres my code

<%@ page language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<html>
<head>
<title></title></head>
<body>
<c:import url="test5.xml" var="xml" charEncoding="ISO-8859-1"/>
<x arse xml="${xml}" varDom="doc" />
</body>
</html>

this is my xml file, but I still get the error "Content is not allowed in prolog"

<?xml version="1.0" encoding="ISO-8859-1"?>
<test><value1>valuex</value1></test>

this is really frustrating, what can I do to fix this problem, when I dont have access to Unix or Linux

Is there an editor for Windows which allows me to check for the special characters which appear before the prolog?
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

All of that goes into the output stream before your XML - no wonder you get that error. Your central mistake is trying to use a JSP where you should be using a servlet.
Bill
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic