File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,9 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
158
158
// Set the text property
159
159
if ([textInProgress length ] > 0 )
160
160
{
161
- [dictInProgress setObject: textInProgress forKey: kXMLReaderTextNodeKey ];
161
+ // trim after concatenating
162
+ NSString *trimmedString = [textInProgress stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]];
163
+ [dictInProgress setObject: [[trimmedString mutableCopy ] autorelease ] forKey: kXMLReaderTextNodeKey ];
162
164
163
165
// Reset the text
164
166
[textInProgress release ];
@@ -172,7 +174,7 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names
172
174
- (void )parser : (NSXMLParser *)parser foundCharacters : (NSString *)string
173
175
{
174
176
// Build the text value
175
- [textInProgress appendString: [ string stringByTrimmingCharactersInSet: [ NSCharacterSet whitespaceAndNewlineCharacterSet ]] ];
177
+ [textInProgress appendString: string];
176
178
}
177
179
178
180
- (void )parser : (NSXMLParser *)parser parseErrorOccurred : (NSError *)parseError
You can’t perform that action at this time.
0 commit comments