Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

premature end of file

 
vidhya subramaniam
Ranch Hand
Posts: 91
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an xml file called AR1048615.xml. I am trying to transform it using saxon. But during the transformation, it fails and gives me the following error:
Fatal error reported by XML parser: premature end of file (found "[EOF]")
URL: file:/work/vsubra/edi/saxon/AR1048615.xml
Line: 123
Column: 0
Error
premature end of file (found "[EOF]"): premature end of file (found "[EOF]")
Transformation failed
Error(s) in transforming the file AR1048615.xml
Line 123 is nothing but the last line /cxml
where the file is closed.
I dont see anything wrong in the xmlfile. How can I fix this
Thanks,
Vidhya
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to open your xml file in IE5.5 or up to see what it tells you.
 
vidhya subramaniam
Ranch Hand
Posts: 91
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roseanne,
When i open the file in IE5.5 or higher , it doesnt give me any error. I tried to open it with a text editor and compare it with files that were working fine without any error , i found that there were some extra spaces between feww lines (may be 1 enter). is that the problem, because when i rmoved those extra spaces and save it it works fine. So how can i fix this error? ( kind of some script or something)
Thanks,
Vidhya
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some extra spaces between feww lines (may be 1 enter). is that the problem,
I would highly suspect that there is a "carriage return" at line 123. I did see problems like this earlier. But unfortunately, in my application it is completely random (or so I think) and I can't reproduce it consistently to debug.
I would love to hear a fix for such things.
I tried using the "strip-space" thingy but it din't take me too long.
regds.
- madhav
 
Rajan Kumar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even I have the same problem, couldn't fix. Any suggestions please?
PS: I removed all the empty spaces, carriage returns from the file. Still the SAX parser gives me the same error.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic