From f881c5ed6e7f623a764025e988275d5f71c6297f Mon Sep 17 00:00:00 2001 From: LeeYZ Date: Sun, 17 Jan 2016 12:29:04 +0800 Subject: [PATCH] Problem is Issues link: https://github.com/amarcadet/XMLReader/issues/15 --- XMLReader.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 XMLReader.m diff --git a/XMLReader.m b/XMLReader.m old mode 100644 new mode 100755 index 754c95a..1a083bb --- a/XMLReader.m +++ b/XMLReader.m @@ -151,7 +151,9 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names { // trim after concatenating NSString *trimmedString = [self.textInProgress stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - [dictInProgress setObject:[trimmedString mutableCopy] forKey:kXMLReaderTextNodeKey]; + if (!([dictInProgress.allKeys containsObject:kXMLReaderTextNodeKey] && [trimmedString isEqualToString:@""])) { + [dictInProgress setObject:[trimmedString mutableCopy] forKey:kXMLReaderTextNodeKey]; + } // Reset the text self.textInProgress = [[NSMutableString alloc] init];