You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Carmona Perez, David" <DP...@fcc.es> on 2004/04/19 16:23:53 UTC

SAXParseException: Content is not allowed in prolog.

Hi all,

I have a problem with Cocoon that I find a little hard to debug.

My pipeline is something like:

<map:read src="myfile.xml"/>
<map:transform type="xinclude"/>
<!--Till here XML received is well formed-->
<map:transform type="saxon" src="mystylesheet.xsl"/>
<map:generate type="html"/>

And receive the following exception (inside Xerces and Saxon):

org.xml.sax.SAXParseException: Content is not allowed in prolog.
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:213)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:385)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:315)
	at org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1309)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScannerImpl.java:809)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:350)
	at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:220)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1162)
	at com.icl.saxon.om.Builder.build(Builder.java:265)
	at com.icl.saxon.functions.Document.makeDoc(Document.java:228)
	at com.icl.saxon.functions.Document.getDocuments(Document.java:134)
	at com.icl.saxon.functions.Document.evaluate(Document.java:70)
	at com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:251)
	at com.icl.saxon.style.XSLParam.process(XSLParam.java:76)
	at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)

How can I guess where it is happening? A breakpoint doesn't help much.
Even though this error, I get correct results.  The problem is that the logs get full and slows my app.

Thanks in advance for any help.

David.

*************************************************************
Este correo ha sido procesado por el Antivirus del Grupo FCC.
*************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SAXParseException: Content is not allowed in prolog.

Posted by Upayavira <uv...@upaya.co.uk>.
Carmona Perez, David wrote:

>Hi all,
>
>I have a problem with Cocoon that I find a little hard to debug.
>
>My pipeline is something like:
>
><map:read src="myfile.xml"/>
>
<map:read>????

><map:transform type="xinclude"/>
><!--Till here XML received is well formed-->
><map:transform type="saxon" src="mystylesheet.xsl"/>
><map:generate type="html"/>
>  
>
If you get content is not allowed in prolog, look for characters before 
the <?xml tag at the beginning of your files. From the stacktrace, I'd 
look at your XSLTs first. Basically, the <? should be ABSOLUTELY the 
first characters in the file. No spaces, no newlines.

Upayavira

>And receive the following exception (inside Xerces and Saxon):
>
>org.xml.sax.SAXParseException: Content is not allowed in prolog.
>	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
>	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:213)
>	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:385)
>	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:315)
>	at org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1309)
>	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScannerImpl.java:809)
>	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:350)
>	at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:220)
>	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
>	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
>	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1162)
>	at com.icl.saxon.om.Builder.build(Builder.java:265)
>	at com.icl.saxon.functions.Document.makeDoc(Document.java:228)
>	at com.icl.saxon.functions.Document.getDocuments(Document.java:134)
>	at com.icl.saxon.functions.Document.evaluate(Document.java:70)
>	at com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:251)
>	at com.icl.saxon.style.XSLParam.process(XSLParam.java:76)
>	at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
>	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
>	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
>
>How can I guess where it is happening? A breakpoint doesn't help much.
>Even though this error, I get correct results.  The problem is that the logs get full and slows my app.
>
>Thanks in advance for any help.
>
>David.
>
>*************************************************************
>Este correo ha sido procesado por el Antivirus del Grupo FCC.
>*************************************************************
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: SAXParseException: Content is not allowed in prolog.

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Carmona Perez, David wrote:
> And receive the following exception (inside Xerces and Saxon):
> 
> org.xml.sax.SAXParseException: Content is not allowed in prolog.

First check your XML files for whitespace before the XML declaration
and text (including NBSPs) outside the document element, as described
in earlier replies. If the problem cause still isn't obvious, update
your JRE to the very latest release, or put the latest Xerces jar in
your JRE's lib/endorsed directory, one of Sun's JRE releases was bundled
with a Xerces release which had a bug causing the error message above in 
certain situations.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org