Simple and good XML parser for C++?

N

none

Andy said:
What platform are you on?

Andy


Linux but could be nice if its possible to get one that also works for windows so I don't need to
write two different versions of my code (it should also run on windows).

I only need very basic stuff, like parsing relative small xml files (few 100 lines) into a
corresponding tree that can be iterated or compute lists of the elements at a given node.
 
C

cpp4ever

Portable? , you must see QT framework: http://doc.qt.nokia.com/4.6/xml-processing.html
You can select to use DOM, SAX or Stream interface.

Other posibility is xmllib (http://xmlsoft.org/).It's really fast.

I've used the QT stream interface and it certainly seems simpler than
either DOM or SAX. That said, depending on how rigorous your
requirements are, it's fairly easy to create a basic XML parser. My
experience of the QT stream interface is on Linux using the gcc compiler
and was made much easier due to the QT documentation provided.

Lastly, you should check licensing issues with any XML library you're
considering. All the best.

JB
 
R

Rui Maciel

wrote:
I only need very basic stuff, like parsing relative small xml files (few
100 lines) into a corresponding tree that can be iterated or compute lists
of the elements at a given node.

Are you sure you need XML? It tends to be mindlessly picked up due to the buzzword factor
alone and as a consequence miss-used a lot, with painful consequences to the programmer. For
example, if you will not be encoding documents then you most certainly will be making a
mistake by adopting XML. If you want to use a language to store/share data then you will be
better off by picking up a data interchange format such as JSON, YAML or even simple
label:value pair sort of language (i.e., INI-style stuff).


Rui Maciel
 
R

Rui Maciel

Andy said:
Well, the one built into Microsoft's .NET run-time system is pretty
platform specific...

This is comp.lang.c++. Nonetheless, Mono does exist.

But mostly because if they are shipped as binaries it depends what they
are built for. The header only ones of course are fine.

To be fair, that doesn't necessarily mean that the parser is platform specific. It just means
that someone screwed up how the code/binaries are being distributed, which artificially and
needlessly limits where the code is able to run.


Rui Maciel
 

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