The moose likes XML and Related Technologies and the fly likes TransformerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "TransformerException" Watch "TransformerException" New topic


Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
I am taking a simple XML file and transforming it into another XML file. It is very basic and very small. However, when I try to transform the XML, I get the following exception:
javax.xml.transform.TransformerException: Premature end of file.
at org.apache.xalan.transformer.TransformerImpl.fatalError(TransformerImpl.java:671)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:647)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1054)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1032)
Thanks in advance!!!

Padam Krishna
Ranch Hand

Joined: Jul 24, 2003
Posts: 37
I suspect your XML is not well formed.
Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
My problem was a simple one unrelated to XML. I was reading the inputstream and printing the information out (debug steps). This moved the internal pointer to the end of file.
Administrator: You can close this topic!
I agree. Here's the link: http://aspose.com/file-tools
subject: TransformerException
Similar Threads
A strange problem of XSLT transformation in Tomcat
Calling a servlet from Java Class and receiving data from servlet
Random occurrence of error
Urgent: simple transformer failing with strange file exception
org.xml.sax.SAXException: Warning: can't output text before document element! Ignori