Results 1 to 5 of 5
hey guys
i knew that we can use xml with c++ but i never done that before...and now i wish to learn it so much..but i read on Internet that ...
- 10-27-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 34
C++ with xml
hey guys
i knew that we can use xml with c++ but i never done that before...and now i wish to learn it so much..but i read on Internet that in order to use xml with c++ i have to install the libraries but i'm not sure which libraries should i install in my ubuntu 10.04...hopefully some experts here can help me as i really wish to learn it...thanks in advanced
- 10-28-2011 #2Linux Newbie
- Join Date
- Apr 2010
- Location
- Novosibirsk, Russia
- Posts
- 136
You can use Qt libraries, there is QtXml module which contains classes such as QXmlStreamReader & QXmlStreamWriter - you can quickly get started with it.
- 10-28-2011 #3Linux Newbie
- Join Date
- Nov 2008
- Location
- Tokyo, Japan
- Posts
- 243
I just did a Google search for you: "C++ API XML parsing libraries".
Probably the best library (in my opinion) is libxml++. It does not require Qt to be installed first. To install the libxml++ libraries on Ubuntu, open a terminal and run the command:That will install the binary libraries (libxml++2.6-2), the C++ headers (libxml++2.6-dev) and the documentation (libxml++2.6-doc).Code:sudo apt-get install libxml++2.6-2 libxml++2.6-doc libxml++2.6-dev
Another good choice is the Apache Xerces++ API. It also does not require Qt to be installed first. To install the Xerces libraries on Ubuntu, open a terminal and run the command:That will install the C++ headers (libxerces-c-dev), the online documentation and manual pages (libxerces-c-doc) and the example files (libxerces-c-samples).Code:sudo apt-get install libxerces-c-dev libxerces-c-doc libxerces-c-samples
In both cases, you will need a super user password to install the files at the system level.
- 10-29-2011 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,977
I have used the xerces library extensively in the past. It works well and seems pretty efficient. I have hand-crafted xml parsers as well, but for situations that required the most efficient possible parsing, such as real-time stock/derivative trading applications. For most C++ programmers, xerces is probably the best, most flexible, and well-supported choice. If you are using Qt for UI/KDE programming, then their library makes sense, but if not, stick with xerces.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-31-2011 #5Just Joined!
- Join Date
- Oct 2011
- Posts
- 34
thanks guys for the info...erm just a quick question...how do i compile this program?is it similar to g++ -o name file.cpp?
can c++ create a xml file or not?being a noob is such a pain..since i didnt get any answer for what i want from reading article i thats why i decided to ask all experts here..thanks in advancedLast edited by nikhidet; 10-31-2011 at 03:16 PM.


Reply With Quote