Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Problem parsing UTF-8 encoded XML file

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have been having issues parsing files that were encoded with UTF-8. If I save the file as standard ANSI and parse it I do not have the issues.
Is there a reason this can occur?
Here is the error I am getting:

C:\Home\Java\testbed\tmp>java RFKGenerator -in 4874.xml -xsl cl_rfk.xsl -out 4874.rfk
Applying stylesheet cl_rfk.xsl...
Exception in thread "main" ; SystemID: file:///C:/Home/Java/testbed/tmp/2.209_M_
4874.xml; Line#: 1; Column#: -1
javax.xml.transform.TransformerException: Document root element is missing.
at org.apache.xalan.transformer.TransformerImpl.fatalError(Unknown Sourc
e)
at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source
)
at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source
)
at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source
)
at gov.nasa.jsc.odfxml.java.RFKGenerator.main(RFKGenerator.java:89)

As I mentioned before this only occurs if the file is encoded in UTF-8 so I am not sure if there is any extra steps needed when parsing these type of files. I am using the latest xalan parser and the xerces processor that apache provides.
If you need any other information please let me know.
thank you.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Report post to moderator
I see you still haven't changed your display name after the last time I asked you to. You do realize that not complying will cause your account to be locked, don't you?
 
El Durango
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am awaiting a reply back from a question I sent to Thomas Paul before I decide on anything, so I suggest that you inform the rest of the "Gestapo" about this and let "Tommy boy" get back to me.
Oh by the way your post was not insightful. :roll:
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Report post to moderator

Originally posted by El Durango:
I am awaiting a reply back from a question I sent to Thomas Paul before I decide on anything, so I suggest that you inform the rest of the "Gestapo" about this and let "Tommy boy" get back to me.
Oh by the way your post was not insightful. :roll:


"Tommy Boy" did get back to you but you chose to ignore me. Since you think that we are the gestapo I am sure you would not want to be a part of JavaRanch. So I am helping you out by closing your account.
 
Trailboss
Posts: 23186
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator

Originally posted by Thomas Paul:

"Tommy Boy" did get back to you but you chose to ignore me. Since you think that we are the gestapo I am sure you would not want to be a part of JavaRanch. So I am helping you out by closing your account.


 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
ok ok I submit. I put in a "real" name this time, now can I have my question answered?
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic