Created
July 22, 2014 18:14
-
-
Save lfarah/451daf82d7549602344d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
NSURL *url = [[NSURL alloc]initWithString:@"http://sistemas.ideastek.com.br/cnordeste/gols_jogadores.xml"]; | |
NSXMLParser *parser = [[NSXMLParser alloc]initWithContentsOfURL:url]; | |
[parser setDelegate:self]; | |
BOOL result = [parser parse]; | |
} | |
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict | |
{ | |
NSLog(@"Did start element"); | |
if ( [elementName isEqualToString:@"root"]) | |
{ | |
NSLog(@"found rootElement"); | |
return; | |
} | |
} | |
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName | |
{ | |
NSLog(@"Did end element"); | |
if ([elementName isEqualToString:@"root"]) | |
{ | |
NSLog(@"rootelement end"); | |
} | |
} | |
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string | |
{ | |
string = [string stringByReplacingOccurrencesOfString:@"\n " withString:@""]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment