views:

374

answers:

5

I was looking for a better (well documented and efficient) xml processing C library.

¿ Ideas ?

+2  A: 

I think you have to define what "better" means to you first. Better in what way? Performance? Ease of API use?

Kendall Helmstetter Gelner
Thanks you. You are right. I am looking for a better in the performance/documentation way.
Jorge Niedbalski R.
Really, other than using the built in pull parser (NSXMLParser) I don't know you are going to find much else... for small documents or for documents where you just want a few elements, the pull parser is pretty good.If you can, use plists as the other responder suggests.
Kendall Helmstetter Gelner
A: 

I have used tinyxml for a while. It's not super advanced, but it's not easy either. Nowadays I use apple's plists.

neoneye
+3  A: 

I think the documentation of libxml2 is not perfect, it's pretty useful. Especially if you use the Code examples.

Maybe you can give some explanation what you miss in the documentation?

I've no experience with the (lack of) performance in libxml2. Actually, I think the (derived) libxslt parser (xsltproc) is pretty fast, but that's probably because the java-alternatives have to read-in the VM first.

You can also write your own XML parser, tune it in the way where you need the speed. It's always a bit of a trade-off: How much time do I spent reading the documentation and examine how it works, and how much work is it to write my own XML read-in routines?

Improving libxml2 so it suits your needs might even be the best, open source friendly, solution but may cost the most time.

Roalt
A: 

I find the libxml2 quite well-documented (and it is in common use, which means that you easily find examples).

Also, I find its performance quite good. Faster than libxml2, you have event-based parsers but they are much less convenient for the programmer.

bortzmeyer
+3  A: 

I don't know about performance (I haven't used either), but Apache Xerces is quite popular. It's C++ though.

There's also RapidXML, which is supposedly crazy-fast and compact. RapidXML is also C++.

Finally, there's Expat.

Can Berk Güder