This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

XML Parsing Error

 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am getting following exception when my code tries to read XML from the string and parse it to build DOM Object,

org.xml.sax.SAXParseException: Illegal character at end of document, >.
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3339)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3333)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:640)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)



Now, its funny because this happens on my development machine but when I write standalone code to read that XML data and parse it the same way it works fine.

Does anybody have clue whats going wrong here?

Thanks
Maulin
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

a correction actually in the exception message in first line the character is,

& # 3 e; (i'm separating by spaces otherwise this HTML will convert it into '>' character)

Regards
Maulin
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Print the string and check if the contents are what the parser is expecting when it is deserializing it. I used dom parser for my protocol and it works pretty well. Also check the xml version tag when serializing it.

~Krishna
SJCP
reply
    Bookmark Topic Watch Topic
  • New Topic