Good C++ XML library

  • Thread starter =?ISO-8859-15?Q?Jens_M=FCller?=
  • Start date
?

=?ISO-8859-15?Q?Jens_M=FCller?=

Can anyone recommend me a good XML library? Should be relatively easy to
use, and especially a good tutorial/handbook would be nice ...

I didn't find the Xerces documentation that helpful ...
 
E

Eduardo Grajeda

Jens Müller escribió:
Can anyone recommend me a good XML library? Should be relatively easy to
use, and especially a good tutorial/handbook would be nice ...

I didn't find the Xerces documentation that helpful ...

If you decide to try a C library you could try
libxml2(http://www.xmlsoft.org/), wich haves lots of examples and its
pretty easy to use. I use it with my C++ projects.

- Eduardo Grajeda
 
R

Rolf Magnus

Eduardo said:
Jens Müller escribió:

If you decide to try a C library you could try
libxml2(http://www.xmlsoft.org/), wich haves lots of examples and its
pretty easy to use. I use it with my C++ projects.

Or if you prefer C++, simply use its C++ binding, libxml++.
 
J

Joe Van Dyk

Rolf said:
Eduardo Grajeda wrote:




Or if you prefer C++, simply use its C++ binding, libxml++.

One problem I found with libxml2++ (and libxml2) is the number of
dependencies it needs. I gave up trying to get it installed on a Redhat
8 machine and used TinyXML instead.

Joe
 
D

dj

Jens said:
Can anyone recommend me a good XML library? Should be relatively easy to
use, and especially a good tutorial/handbook would be nice ...

I didn't find the Xerces documentation that helpful ...

I used TinyXml in my last project as well.
 
Y

Yannick Tremblay

Or if you prefer C++, simply use its C++ binding, libxml++.
I would certainly recommend using libxml++ above libxml2 directly.

Although libxml2 has very extensive capability, the memory management
in it is a a total nightmare. If you use it directly, forget about
good RAII practices. Various functions can return a pointer to memory
owned by another object that you shouldn't touch or memory that has
been allocated by this function and that you are responsible to free.
Freeing this memory is done via a function call but which function
call depend on what function allocated the object (xmlFree,
xmlFreeDoc, xsltFreeStylesheet, xmlXPathFreeObject, etc. etc). And
sometimes, the content of the allocated object contains pointers to
memory owned by another object. And don't forget to initialise your
library and clean up afterward with xmlCleanupParser(). Etc. etc.

To its credit, it works. So it might be worth using and is most
probably better than implementing your own xml parser from scratch. I
would just have liked it to use better (and more consistent) ownership
patterns.


Yan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top