Archived

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

neurokaotix

Which XML parser do you recommend?

Recommended Posts

Guest Anonymous Poster   
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
neurokaotix    100
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
Guest Anonymous Poster   
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
neurokaotix    100
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
Rule    122
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
abdulla    164
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
lonestarrr    122
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
darookie    1441
quote:
Original post by antareus
Is TinyXML able to store wide character strings yet?

AFAIK it is not, but you can easily modify the source
code to enable it.

Share this post


Link to post
Share on other sites
chollida1    532
I''m surprised no one has mentioned Microsoft''s very nice MSXML. Its very solid and you know its well backed

If you just need to parse XML its definetly one of the best
Cheers
Chris

Share this post


Link to post
Share on other sites
neurokaotix    100
quote:
Original post by chollida1
I''m surprised no one has mentioned Microsoft''s very nice MSXML. Its very solid and you know its well backed

If you just need to parse XML its definetly one of the best
Cheers
Chris


I''m interested in cross-platform solutions

MindEngine Development
http://medev.sourceforge.net

Share this post


Link to post
Share on other sites
chollida1    532
Too bad, sorry about that, its really quite good. my recomendation would then be TinyXML as its very small and functionally complete.

Xeries brings in more baggage as its not strictly for XML, we use it as our SVG parser

Cheers
Chris

Share this post


Link to post
Share on other sites