I am studying the use of the NSXMLParser API for the iOS platform and is still very easy to use. However, I have a little problem in the foundCharacters method. As far as I understand, it should not select any spaces, since the foundIgnorableWhitespace method should catch this, but it looks like it is. Here is my code ...
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
It basically stores three "temporary" elements in an array. The problem, however, is that it seems to be collecting spaces as a new line. Here's a listing of the array in the console ...
Printing description of listOfTimes: ( "2010-08-21T22:00:00-05:00", "\n ", "2010-08-22T01:00:00-05:00" )
and here is a piece of XML data that I am processing ...
<time-layout time-coordinate="local" summarization="none"> <layout-key>k-p3h-n40-1</layout-key> <start-valid-time>2010-08-21T22:00:00-05:00</start-valid-time> <start-valid-time>2010-08-22T01:00:00-05:00</start-valid-time> <start-valid-time>2010-08-22T04:00:00-05:00</start-valid-time> <start-valid-time>2010-08-22T07:00:00-05:00</start-valid-time> <start-valid-time>2010-08-22T10:00:00-05:00</start-valid-time> . . .
I donโt understand how it works?
Thanks in advance for your help!
ios iphone ipad nsxmlparser
BeachRunnerFred
source share