Its not that hard to parse XML. Use the NSXMLParser class, use your own class as a delegate to it, and implement didStartElement and foundCharacters. Inside the didStartElement class find the elements you want, and set some state on your class. The "foundCharacters" delegate will process the text inbetween the xml tags.
NSXMLParser *parser = [[NSXMLParser alloc]initWithData:data];
[parser setDelegate:self];
[parser setShouldProcessNamespaces
[parser setShouldReportNamespacePr
[parser setShouldResolveExternalEn
if ( [parser parse] == YES )
{
NSLog(@"success");
}
[parser release];
}
// XML delegate methods
-(void)parser:(NSXMLParser
NSLog(@"%@", elementName);
if ( [elementName isEqualToString:@"TradeDat
{
NSLog(@"TradeData");
node = xmTrades;
} else if ( [elementName isEqualToString:@"ErrorMes
{
node = xmErrorMessage;
}
}
-(void)parser:(NSXMLParser
Main Topics
Browse All Topics





by: fridomPosted on 2008-04-10 at 23:01:35ID: 21331616
to 1) check for libxml2 and possible wrappers, on apples especially check out: /documenta tion/Cocoa /Conceptua l/ XMLParsi ng/Article s/UsingPar ser.html
/documenta tion/Legac yTechnolog ies/ WebObj ects/WebOb jects_4.0/ System/Doc umentation /Developer / Enterpris eObjects/G uide/Guide TOC.html
http://developer.apple.com
to 2) every Database has some C-API. You always can access them from Objective-C in a C way if you like. But if we are talking aboout Macs then you mean probably
Apple's Enterprise Objects Framework
http://developer.apple.com
Regards
Friedrich