Jump to content
  • Advertisement
Sign in to follow this  
lo1989

xml

This topic is 4632 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

Hi! i want to use xml for my gameconfig and my GUI-config. till now i used binary files but for my redesign of a new GUI System a want to use xml files because of the simpler changeability. what c++ (not managed) xml - parsers to you prefer? Or is it much slower than loading/reading my binary files. (only small files).?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

If you just want to have a "readable" file format to allow fast editing of the gui, and your files are quite simples, then you should write your own ascii format. It will be faster / easier to implement.

And for XML, I used MSXML. I think there is simpler libraries for xml, but I didn't want to include another .lib / headers in my project, so I used MSXML.

[Edited by - paic on November 10, 2005 4:40:23 AM]

Share this post


Link to post
Share on other sites
I believe MSXML 3.0 is included with IE6, but I don't think MSXML 4.0 is included with any system components (maybe IE7, but it's only in beta at the moment)

Still, since MSXML is COM-based, you don't actually have to link to any libraries, you just need the typelib or headers...

Share this post


Link to post
Share on other sites
eh, I shouldn't have specified "4.0" ^^
I'm just including <msxml2.h>. I never went into the details so I don't really know how it works internally. But as far as I know, it works on any Windows machine it has been tried on.

Share this post


Link to post
Share on other sites
I also vote for TinyXML. It's very easy to use... much easier than writing your own text file parser unless you text files are VERY simple.

Share this post


Link to post
Share on other sites
I normally use libxml2. It's a small, compact, validating XML parser / writer. I discovered it just at the right moment to keep me from going insane with Xerces *BARF*.

Share this post


Link to post
Share on other sites
Quote:
Original post by lo1989
Or is it much slower than loading/reading my binary files, (only small files)?

For small files the difference is not really noticeable, but for large files it is a pain. My current project uses TinyXML to load the entire world structure, 40-50 xml files each of several hundred lines (generated by another tool, I didn't write them all by hand), which takes 45+ seconds on my machine. In contrast, I am switching to a binary format (file content debbuging is largely over), which takes only 4-6 seconds to load the same data.
I recall simple ascii files are somewhere in between (depending on the complexity of the formatting, of course).

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!