XML Parser

Started by
8 comments, last by shuma-gorath 10 years, 9 months ago

I've been looking for an XML library to use, not for any project in specific because I have many ideas for projects that could use an XML library. I want to know what other people use and how they worked for you.

SAMULIKO: My blog

[twitter]samurliko[/twitter]

BitBucket

GitHub

Itch.io

YouTube

Advertisement

tinyxml, I havent moved to tinyxml 2.0 yet, but I havent had any problems with the original.

http://www.grinninglizard.com/tinyxml/

http://sourceforge.net/projects/tinyxml/

I used Xerces on C++.

http://xerces.apache.org/xerces-c/

It was extremely robust, and also contains a SAX parser (which is more memory efficient than DOM) .

It also has validator schemas, and just about anything you might ever want from XML.

The downside, was that it takes a long time to compile, and produces a huge binary.

But for enterprise level XML it's the best.

That was a couple of years ago. Since then, I've moved to jSon wherever I can, and have never looked back. If you have the option to avoid XML, you should.

My Oculus Rift Game: RaiderV

My Android VR games: Time-Rider& Dozer Driver

My browser game: Vitrage - A game of stained glass

My android games : Enemies of the Crown & Killer Bees

http://rapidxml.sourceforge.net/ It doesn't support everything but is very fast: http://rapidxml.sourceforge.net/manual.html#namespacerapidxml_1performance_charts

For C++, I use both TinyXML (pre-v2) and pugixml. I find Pugixml to be faster in reading, writing, and typing, but writing to a string is less intuitive
(you have to derive from the Writer class). I would say TinyXml's class has an intuitive class hierarchy, but there's a bit more typing, especially in v1, and dealing with large XML files is slow.

Choosing the right XML parsing library depends upon what you need to do.

Xerces will do everything: validation, SAX-style parsing, etc. and is extremely robust; however, it is really heavy-weight and kind of a pain in the ass all around. If you don't have advanced needs: if you don't need to parse huge XML files;if you are not worried about absolute XML standard conformance and so forth; then don't use Xerces or anything like Xerces.

If you just need to parse a few modestly-sized XML files for a game project, use TinyXML and you will be fine.

Also I have a question regarding TinyXML ... everyone is recommending v1, which I would too, but I know in my case it's really based on the fact that I started using v1 and never had any problem with it so I saw no reason to switch and have to learn a new interface or possibly have specific v2-related problems. Is this why everyone is recommending TinyXML v1? Or have some people actually tried TinyXML v2 and had problems?

I'm in love with pugixml. It's lightning fast, supports Unicode, XPath 1.0, very lightweight, has both a header-only version and a header+source version, etc.

Of course, I'm assuming you're using C++, as you didn't say what language you're using.

[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

I use RapidXml in my projects - it's a fast, easy to use, 4 files, header only API, thus can be integrated quite easily. -> http://rapidxml.sourceforge.net/ .


Of course, I'm assuming you're using C++, as you didn't say what language you're using.

It'd have to be C++ as it's pretty much the only mainstream language out there that doesn't have an xml parser as part of it's standard library :)

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

Also I have a question regarding TinyXML ... everyone is recommending v1, which I would too, but I know in my case it's really based on the fact that I started using v1 and never had any problem with it so I saw no reason to switch and have to learn a new interface or possibly have specific v2-related problems. Is this why everyone is recommending TinyXML v1? Or have some people actually tried TinyXML v2 and had problems?

Yeah, that's prettily much why I stayed with v1.

This topic is closed to new replies.

Advertisement