Parsing XML with C++

Started by
12 comments, last by Xai 19 years, 3 months ago
Thanks guys. I'll try out TinyXML.

-Nick
Advertisement
If the validation is important to you, you could use a third-party web-service (like W3C's XML validator) to validate the document in conjunction with TinyXML's parsing for local tasks. For instance, each time a user wants to save to a previously validated document, you could run the parser against it; if it passes, send it to the web service. If the web service returns a success code, you allow them to save; if not, you can throw an exception.
- k2"Choose a job you love, and you'll never have to work a day in your life." — Confucius"Logic will get you from A to B. Imagination will get you everywhere." — Albert Einstein"Money is the most egalitarian force in society. It confers power on whoever holds it." — Roger Starr{General Programming Forum FAQ} | {Blog/Journal} | {[email=kkaitan at gmail dot com]e-mail me[/email]} | {excellent webhosting}
We use libxml2 for Eternal Lands, and we are very happy with it.
I use .NET XML processing when I'm in C# .. but in C++ I'm not happy with anything I've tried ... and plan to try TinyXML soon, for the simple stuff. Ruby has a great little XML library called ReXML, but that does nobody any good who doesn't use ruby (a good 99.99% of the world).

The problem with Xerces is, it very closely resembles the original DOM just as Java does in nearly every aspect, which has quite a few things which have been modeled more cleanly since ... and what's worse, not everything is supported, so you have a really large complicated API that is only 80% complete. And to top that off, they haven't provided the utility functions that could make life really easy, and instead give you sample projects for you to copy to roll your own ...

Basically, 3-4 years ago when I first used it, it was kinda hard, but impresive and featurefull for the time. Now its just a painfull dinasaur I still occasionaly have to use (when in cross platform C++).

This topic is closed to new replies.

Advertisement