xml

Started by
13 comments, last by Vexorian 18 years, 5 months ago
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).?
Advertisement
I've had success with tinyxml. You might give it a try.
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]
How did using MSXML not make you include another library to your project? Was it already a part of it?
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...
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.
I use TinyXML. There's an article linked in my profile showing you how to use it for games.
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.
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*.
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).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement