Hi, I guess your log statement reads the body. If the body returned by your http endpoint is a stream and you do not have stream caching enabled on your route the stream will be read and the body will be empty afterwards. The XML parser used to process your XSLT mapping will then get an empty document, which will result in this premature EOF error...
So either remove your log statement (or move it after the conversion to string) or enable stream caching on your route. That should help. Best regards Stephan -----Original Message----- From: Varsha167 [mailto:varsha.tiw...@target.com] Sent: Montag, 27. Juni 2016 07:15 To: dev@camel.apache.org Subject: Premature End Of File Error in XML I am trying to parse an XML file through a Camel Code. This is a portion of my Camel Code where I am parsing the XML : .to("http://abc.apt.com") .log("Response received - ${body}") .log(LoggingLevel.INFO, "UPCI Fetched") .convertBodyTo(String.class) * .to("xslt:xslt/FPFormatting.xsl")* //.marshal(xmlJsonFormat) .log(LoggingLevel.INFO, "response received ${body}") .end(); The above code gives me an error : * 2016-06-24 17:27:26 WARN o.a.c.component.seda.SedaConsumer - Error processing exchange. Exchange[][Message: ]. Caused by: [javax.xml.transform.TransformerException - ParseError at [row,col]:[1,1] Message: Premature end of file.] javax.xml.transform.TransformerException: ParseError at [row,col]:[1,1] Message: Premature end of file.* When executed individually, the XSLT (FPFormatting.xsl )is producing correct XML results. Only when I execute the code, it gives me the above error. I tried adding Saxon dependency in Gradle, tried converting the body to string, but this is not working. -- View this message in context: http://camel.465427.n5.nabble.com/Premature-End-Of-File-Error-in-XML-tp5784421.html Sent from the Camel Development mailing list archive at Nabble.com.