Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

error while validating xml file.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai all,
I am getting following exception when i am trying to validate an xml document using DOM PARSER.
Failed to validate the XML. org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xff) was found in the prolog of the document.

Thanks in advance.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is pretty self explanatory - XML expects to see only valid Unicode characters. Possible sources of invalid characters that I can think of right off-hand:
1. MS Word "smart" punctuation where text is cut and pasted from a Word DOC into XML.
2. Reading the input file with the wrong character encoding.

A programmer's editor that can show Hex values of characters is invaluable in tracking down this sort of thing. I use UltraEdit-32 - it is not free but for something I use all the time it is worth evey dime.
Bill
 
raghuveer mandal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem got solved. Thanks for your advice.
Regards
Raghuveer Mandal.
[ June 06, 2005: Message edited by: raghuveer mandal ]
 
What are your superhero powers? Go ahead and try them on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic