Jump to content

  • Log In with Google      Sign In   
  • Create Account


XML Parser


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 samgj   Members   -  Reputation: 378

Like
0Likes
Like

Posted 06 July 2013 - 02:41 PM

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.


MLNM-ONE: open source video game engine

Unincorporated Media's Website: my company's website


Sponsor:

#2 NumberXaero   Prime Members   -  Reputation: 1264

Like
2Likes
Like

Posted 06 July 2013 - 04:02 PM

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/



#3 SillyCow   Members   -  Reputation: 835

Like
0Likes
Like

Posted 06 July 2013 - 04:32 PM

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 new android game : Enemies of the Crown

My previous android game : Killer Bees


#4 _swx_   Members   -  Reputation: 874

Like
0Likes
Like

Posted 07 July 2013 - 05:37 AM

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

#5 shuma-gorath   Members   -  Reputation: 882

Like
0Likes
Like

Posted 07 July 2013 - 08:08 AM

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.


Edited by shuma-gorath, 07 July 2013 - 08:10 AM.


#6 jwezorek   Crossbones+   -  Reputation: 1606

Like
0Likes
Like

Posted 07 July 2013 - 11:01 AM

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?


Edited by jwezorek, 07 July 2013 - 12:47 PM.


#7 Cornstalks   Crossbones+   -  Reputation: 6966

Like
1Likes
Like

Posted 07 July 2013 - 11:26 AM

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.


[ 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 ]

#8 Eliad Moshe   Members   -  Reputation: 796

Like
0Likes
Like

Posted 07 July 2013 - 12:17 PM

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/ .


Edited by Eliad Moshe, 07 July 2013 - 04:56 PM.


#9 ChaosEngine   Crossbones+   -  Reputation: 2101

Like
0Likes
Like

Posted 07 July 2013 - 03:23 PM


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

#10 shuma-gorath   Members   -  Reputation: 882

Like
0Likes
Like

Posted 07 July 2013 - 04:17 PM


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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS