Parsing xml file using xerces C++ - c++

I have an xml file to be parsed for the information contained to be further used. Can anyone help me with the xerces C++ code for parsing it? I have the xml creation code using xerces library as well in C++.

Maybe this doesn't help you much if you're already committed to xerces, but I'd recommend using pugixml instead. It's very easy to integrate, is very performant and has excellent documentation. I built a rather large project using it and had nothing but good experiences with it. It's of the nicest libraries I've ever used. (I'm not affiliated with them; just very happy).
Here is the documentation on parsing files: http://pugixml.googlecode.com/svn/tags/latest/docs/manual/access.html

Related

Does anyone know C++ XML parser/writer similar to .Net's XML Document?

I'm writing a native C++ project and I need a simple XML parser/writer. I already know XmlDocument in C#, so something similar could be quite good, but if there isn't, does anyone know a quick-to-use XML parser/writer?
I'm trying to shorten my "learning of the library" time to minimum.
Thanks!
There are quite a few you can consider:
Xerces
TinyXML
libxml++
Expat Xml
XmlLite
I've used TinyXML, and it's worked reasonably well for what I've needed. My needs weren't terribly demanding though. At least when I used it, it didn't deal with DTD/XSD at all, so if you need to handle those it's probably not an option.
I ended up using RapidXML (http://rapidxml.sourceforge.net/).
For me, its intuitive, and was really easy to learn.
No body recommended it so I added my own answer :-\ ...

Read XML on LINUX

I have requirement where we have to read a small XML file on Linux. Our application is in C++ and I like to use any light weight XML library. Please suggest me the library.
Thanks
You can Try pugixml Light-weight, simple and fast XML parser for C++
As a 2nd option look at TinyXML
Have a look also at TinyXml (http://sourceforge.net/projects/tinyxml). It is extremely lightweight and for this reason it is used also in mobile and game programming. The API is minimal though so you have to evaluate if it fully satisfy your needs.
This xml parser is good
There is xerces-c for that. It's complete, but I don't know if you will find it small enough. Your question is relative to what?

Need to find the difference between two XML files in C++

Is there any library for this, or does anyone have anything done in Xerces, or any link on how to do this, or any API or any way to do this in Xerces?
I don't think Xerces includes an XML diff algorithm. If you want to implement it yourself, check out this thesis and the accompanying Java code.

Managing XML in C++

I need to manage (parse and build) XML in my c++ application but I have no idea about libraries that can help me doing that. I searched in Boost but found none, std namespace sure does not provide such functionalities. Is there a free c++ library to manage xml?
Thank you
TinyXML
Xerces-C++
RapidXml
others
Arabica is a very nice and standard-friendly wrapper for different XML parsers.

Best XML Library in C++, Fast Set-Up

I was wondering what is the best XML Library in C++ (I'm using Visual Studio), considering fast set-up is critical. Basically, I want to create a file to save annotations on various .avi files.
Thank you in advance.
You should be able to get TinyXML set up and working in a matter of minutes.
TinyXML is simple enough for almost all your use (if you don't bother having the whole xml representation in memory) but other libraries offer better important features :
RapidXML is made to be really really fast. It's used in the boost::property_tree library for the xml file read/write features. If you already use boost, using directly boost::property_tree might be a good idea, if adequate, as you already can easily use it with it's simple interface.
pugiXML has been mentionned as a good replacement for RapidXML by someone on the boost mailing list, but I'm not aware of the differences.
Xerces-C++ is made to allow you high level manipulations on xml like validation using xsd files -- but is really heavy on both speed and memory size...
wrappers around classic C xml libraries (like LibXML2) might be interesting choice if you don't find what you're looking for with the previous ones...
I've used XercesC++ in the past and it was relatively painless to get working and working with.
I'm currently using MSXML and it is painful.