Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
Getting started using KissXML
On Mac OS X, Apple provides the NSXML class cluster for working with XML elements (NSXMLDocument, NSXMLElement, NSXMLNode). However, they do not provide these classes on iOS. KissXML is designed to be a drop-in replacement for Apple's NSXML class cluster on iOS. (For more information, see the reference page.)
The project contains two folders within its root directory:
- KissXML - Contains the implementation files.
- UnitTesting - Various testing code to ensure KissXML operates just like Apple's classes.
To use KissXML within your project, there are two steps:
- Copy the KissXML folder into your project (ignore the UnitTesting folder)
- Configure Xcode to work with libxml2
The KissXML folder contains:
- DDXML.h (Standard header file you will #import)
- Additions/DDXMLElementAdditions (this is optional, all the others listed above are required)
After adding the KissXML folder you'll need to add libxml2 to your Xcode project. There are 2 steps to this process:
- Tell Xcode where it can find the libxml2 header files so it will compile
- Tell Xcode where it can find the libxml2 compiled library so it will link (last step of compiling)
You'll be adding this to your compiler instructions (at project level, not target level)
- OTHER_LDFLAGS = -lxml2
- HEADER_SEARCH_PATHS = /usr/include/libxml2
Automatic Reference Counting (ARC)
The latest versions of KissXML use ARC. If you're not using ARC in your project, learn how to properly flag the KissXML files as ARC in your Xcode project on the ARC page.