views:

117

answers:

4

Hi,

I'm looking for a way to parse XML in C++ in Windows and I've found a few such as MSXML, Xerces, TinyXml etc but I'm wondering which is best in terms of performance and features. My requirements are that it must be able to be static linked or have the source included in the project itself and must not require any additional toolits such as boost. MSXML would be the obvious choice as it's an MS library but it seems to be a COM library and rather convoluted to actually get any use out of it.

Does anyone have any suggestions as to something quick and simple to use?

Thanks, J

+2  A: 

I used libxml with success. The API is a bit confusing and complicated, but once you get it it works pretty good. Besides it is stuffed with functionality, so if you need that, go with libxml. You dont have to worry about bloated binaries since you can only link the parts you need. You dont need to include the complete libxml if you only need to parse xml and dont use the xpath stuff for example

Henri
Perfect! I've just checked out libxml2 and it is exactly what I'm looking for, I've got it up and running in no time. Thanks.
A: 

The best library that I've used and which is absolutely transparent in usage and understanding terms was pugixml.

Extremely lightweight, very fast, flexible and convenient - what else could one expect?

Kotti
A: 

The expat library is probably the best and easiest to use

xcramps
@xcramps: Care to elaborate on the "... probably the best and easiest to use" part? Tried them all, I assume?
Johann Gerell
A: 

The heavyweight daddy of XML parsers is Xerces
A simpler easier parser Expat there are C++ wrappers around.

There are a lot of XML parsers around.
A quick Google will find you plenty.

Martin York