Skip to content

StarClutch/XML-Parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XML-Parse

Easy to use XML Parser that outputs in dictionary format written in Objective-C.

Bug or Feature Request? Open an issue :)

CI Status Version License Platform

Example

  1. Run pod try XML-Parse.
  2. If pod try does not work: clone the repo, and run pod install from the Example directory first.

Requirements

iOS 9.0+

Installation

XML-Parse is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "XML-Parse"

Usage

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

Author

Blake, shetter.blake@gmail.com

License

XML-Parse is available under the MIT license. See the LICENSE file for more info.