Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

neurokaotix

Which XML parser do you recommend?

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

I''ve looked at Xerces-C++ and I''ve heard of TinyXML, but I''m not sure which I sure use. I''m going to be using it to parse xml-based material/gui scripting for my project. Does anyone have any good/bad expirience in this field? MindEngine Development http://medev.sourceforge.net

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I would highly recommend Xerces. If, for the only reason it is a validating parser. The value of the validation in my mind is huge. The API itself is pretty clean (although I think the examples are somewhat poor, rather, overly complex).

I''ve used Xerces both for my own projects (similar to your goals) as well as professionally (cross platform too! Windows, Linux, Solaris & Irix).

The biggest downsides are it is a DLL (not a .lib, althought you could probably figure out how to re-link it) and it is fairly large. I don''t mind tagging along a 3rd party DLL with my projects, and I''m not super memory constrained (at least not enough to worry about the size of the DLL code).

Share this post


Link to post
Share on other sites
I looked at Xerces and did take note that it validates... is that really useful? Is that basically the equivilant of debugging for XML? TinyXML does not validate but it is, well, tiny. I''m not too worried about the .dll issue either, however the more dlls users have to download the worse off my turn-over rate will be I think.

MindEngine Development
http://medev.sourceforge.net

Share this post


Link to post
Share on other sites
Upon compiling TinyXML (very few source files -- it really IS tiny!), I noticed that it is made into a static lib which I think I like.

tinyxml src download: 137kb
xerces-c++ src download: 12mb

MindEngine Development
http://medev.sourceforge.net

[edited by - neurokaotix on January 7, 2004 3:20:09 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Remember to bear in mind how much data the library stores per-node as this will become a vital bottleneck when dealing with large XML files (we''ve had to write our own as we deal with XML files as large as 20MB and all free libraries were prohibitively expensive when loading them).

Share this post


Link to post
Share on other sites
Thankfully for its purpose, the XML files used in my project should never reach a size like that. I would say that they would never go over 15-20kb each.

Also, Xerces has a crazy amount of stuff in their source d/l. I suppose I was looking for a reason to not use Xerces and the fact that it wouldn't build correctly on my first (and only) attempt really made me dislike it. Though I suppose I should really read the manual on it before I just say it doesn't work at all for me.

Before I say I'm not going to use it I think I should give it a good look-though and whatnot. It will probably serve me better in the future to go with a library that has validation.

MindEngine Development
http://medev.sourceforge.net

[edited by - neurokaotix on January 7, 2004 6:20:01 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by neurokaotix
Upon compiling TinyXML (very few source files -- it really IS tiny!), I noticed that it is made into a static lib which I think I like.

tinyxml src download: 137kb
xerces-c++ src download: 12mb


You probably compiled the demo program. TinyXML is made so that you can just include the files into your project. I also use it and it''s very simple and indeed tiny! Just 4 source files and 2 headers. But I guess you can also make it as a static lib. It also has a very nice license. You can use it for commercial software.


Share this post


Link to post
Share on other sites
Or you could try a different parser type (was it pull vs push?) - with libxml2 you can use the xml reader interface which is fast and light on memory, it only stores what you are reading at the moment, not the whole document.

Share this post


Link to post
Share on other sites
I use tinyXML in my project. It works great, but don't forget to call at app startup : setlocale(LC_ALL,"");
if you intend to store extended ascii characters (european, etc). If you use XML to store file path, know that paths may have some of these characters in european/asian langages ...

see this thread :
http://sourceforge.net/forum/forum.php?thread_id=959583&forum_id=172103
all the best,
-lonestarrr


[edited by - lonestarrr on January 7, 2004 6:38:56 AM]

Share this post


Link to post
Share on other sites

  • 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!