This repository was archived by the owner on Feb 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Home
filipenf edited this page Nov 9, 2012
·
7 revisions
Welcome to the libxml-cpp-wrapper wiki!
This project is a simple library that wraps libxml's APIs in order to make it easier to C++ developers to use libxml. I created it because I don't like the way libxmlpp works and I wanted a simpler API.
As simple as:
list<XMLNode> nodes;
XMLReader reader(xml_string);
reader.parse(nodes);
XMLNode &node = *nodes.begin();
string office_phone = node["Customer"]["ContactInfo"]["OfficePhone"].text;for a xml like this:
<CustomerList>
<Customer>
<Name>John Smith</Name>
<ContactInfo>
<Address>22 Acacia Avenue</Address>
<OfficePhone>123456</OfficePhone>
</ContactInfo>
</Customer>
</CustomerList>* libxml2
* cmake ( optional )
Option 1: Just copy the .cpp and .h files to your project and build it.
Option 2:
- Clone git repository
git clone git://github.com/filipenf/libxml-cpp-wrapper.git
- Build the project
mkdir build && cd build
cmake ../libxml-cpp-wrapper
make && sudo make install
You can get some error while including libxml2 headers. The included path in the cmakelists is /usr/local/include/libxml2/, you can adjust it for your system.
After the instalation a library named xmlcppwrapper will be installed in your system. You should link your project to it.