Need to find the difference between two XML files in C++ - 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.

Related

Parsing xml file using xerces 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

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?

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.

How to get values of attributes on a XML file using C++?

Need to write some C++ code that reads XML string and if i do
something like:
get valueofElement("ACTION_ON_CARD") it returns 3
get valueofElement("ACTION_ON_ENVELOPE") it returns YES
XML String:
<ACTION_ON_CARD>3</ACTION_ON_CARD>
<ACTION_ON_ENVELOPE>YES</ACTION_ON_ENVELOPE>
Any code example would be helpfull
Thanks
writing an xml parser is not necessarily an easy thing to do, so unless it is a requirement you do it yourself I suggest you get a library to do that for you.
There are many available like xerces (pretty complete but not exactly simple), tinyxml (mostly the opposite of xerces, it probably suits best your needs) or libxml (never tried this one)
If you have the schema, you could use codesynthesis xsd compiler.
I recommend the XML parser from the Poco C++ library. It's well documented and easy to use.

Minimal XML library for C++?

What XML libraries are out there, which are minimal, easy to use, come with little dependencies (ideally none), can be linked statically and come with a liberal license? So far, I've been a pretty happy user of TinyXML, but I'm curious what alternatives I have missed so far.
expat is a very fast C XML parser (although a C++ wrapper exists) that's widely used in many open-source projects. If I remember correctly, it has very few dependencies, and it's licensed under the very liberal MIT License.
I recommend rapidxml. It's an order of magnitude smaller than tinyxml, and doesn't choke on doctypes like tinyxml does.
If you need entity support or anything advanced, forget about static linking and use expat or libxml2.
FWIW there is also a version of TinyXML with a more C++-like interface, called ticpp.
There's one called libxml2.
There's also a Windows-only solution, a COM library that's part of the O/S, called msxml.
In "what’s the easiest way to generate xml in c++?" I wrote a comment that lists a few C++ XML libraries
TinyXML++ (ticpp) was, IMHO, the most appropriate for a small, easy to use XML library in C++.