Jump to content
  • Advertisement
Sign in to follow this  
rsegal

Trouble parsing end of XML document from memory

This topic is 5094 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I'm using MSXML 3. I'm parsing through my XML doc which is setup in memory rather than parsing from a file and I get this fatal error called... Fatal Error at file (null), line 2, char 88 Message: Invalid at the top level of the document. where line 2, char 88 is the final character of the XML text. It don't make no sense! I've tried making the last character a null character, I've tried making it a blank character I've tried making the last character the final bracket of the XML document and stll it flags this error. I'm running out of ideas here. If anyone has used MSXML I would appreciate any advice you have.

Share this post


Link to post
Share on other sites
Advertisement
The problem is probably not the last character. The parser probably decided that something was wrong when it got to the end and never found something it was looking for.

Share this post


Link to post
Share on other sites
Mabey you need a newline char at the end of the file. Some XML parsers will read until a newline char and then process the line.
I would also recommend the expat parser. I use it and it work great. It's very easy to use and is pretty fast as well.

Try parsing a simple file like this:

<?xml version='1.0' standalone='yes'?>
<root>
<test/>
</root>

Dont forget the line break at end. And if the parser fails, you are either using the library wrong or it is bugged.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!