Find the answer to your Linux question:
Results 1 to 5 of 5

Thread: C++ with xml

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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

  2. #2
    Linux Newbie
    Join Date
    Apr 2010
    Novosibirsk, Russia
    You can use Qt libraries, there is QtXml module which contains classes such as QXmlStreamReader & QXmlStreamWriter - you can quickly get started with it.

  3. #3
    Linux User
    Join Date
    Nov 2008
    Tokyo, Japan
    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:
    sudo apt-get install libxml++2.6-2  libxml++2.6-doc  libxml++2.6-dev
    That will install the binary libraries (libxml++2.6-2), the C++ headers (libxml++2.6-dev) and the documentation (libxml++2.6-doc).

    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:
    sudo apt-get install  libxerces-c-dev  libxerces-c-doc  libxerces-c-samples
    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).

    In both cases, you will need a super user password to install the files at the system level.

  4. $spacer_open
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    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!

  6. #5
    thanks guys for the info...erm just a quick 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 advanced
    Last edited by nikhidet; 10-31-2011 at 03:16 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts