Easy to use XML Parser that outputs in dictionary format written in Objective-C.
Bug or Feature Request? Open an issue :)
- Run
pod try XML-Parse
. - If
pod try
does not work: clone the repo, and runpod install
from the Example directory first.
iOS 9.0+
XML-Parse is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "XML-Parse"
First of all, init your XMLParse class:
XMLParse *parse=[[XMLParse alloc] initWithParseURL:@"URL.xml"];
Next set the delegate (to it's caller) and call the method parse
:
parse.delegate=(id)self;
[parse parse];
Finally receive the success or fail notifications using:
-(void)XMLParseDidFinishSuccessfully:(NSArray *)xml{
NSLog(@"Success");
NSLog(@"%@",xml);
}
-(void)XMLParseDidFail{
#warning - handle failed XML parse here
NSLog(@"Failed VC Parse");
}
Some options you can use before calling parse
:
parse.startingTreeElement=@"item"; // - most start with item - this allows you to overwrite it - defult: item
parse.cleanString=YES; // - a lot of XML feeds include \n & \t at the front and back of the string - this gives you the opion to remove that content - default: YES
Blake, shetter.blake@gmail.com
XML-Parse is available under the MIT license. See the LICENSE file for more info.