ObjFW  Diff

Differences From Artifact [47f877a838]:

To Artifact [8b1f567d63]:


86
87
88
89
90
91
92


93
94
95
96
97
98
99
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101







+
+







	}

	return self;
}

- (void)dealloc
{
	[delegate release];

	[cache release];
	[name release];
	[prefix release];
	[ns release];
	[attrs release];
	[attr_name release];

132
133
134
135
136
137
138
139



140
141
142
143
144
145
146
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148
149
150







-
+
+
+







					[cache appendCString: buf + last
						  withLength: len];

				if ([cache length] > 0) {
					OFString *str;

					pool = [[OFAutoreleasePool alloc] init];
					str = [cache stringByXMLUnescaping];
					str = [cache
					    stringByXMLUnescapingWithHandler:
					    self];

					[delegate xmlParser: self
						foundString: str];

					[pool release];
				}

338
339
340
341
342
343
344


345
346
347
348
349
350
351
352
353
354


355

356
357
358
359
360
361
362
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362

363
364
365
366
367
368
369
370







+
+










+
+
-
+







			last = i + 1;
			state = OF_XMLPARSER_IN_ATTR_VALUE;
			break;

		/* Looking for attribute value */
		case OF_XMLPARSER_IN_ATTR_VALUE:
			if (buf[i] == delim) {
				OFString *attr_val;

				len = i - last;
				if (len > 0)
					[cache appendCString: buf + last
						  withLength: len];

				if (attrs == nil)
					attrs =
					    [[OFMutableDictionary alloc] init];

				pool = [[OFAutoreleasePool alloc] init];
				attr_val = [cache
				    stringByXMLUnescapingWithHandler: self];
				[attrs setObject: [cache stringByXMLUnescaping]
				[attrs setObject: attr_val
					  forKey: attr_name];
				[pool release];

				[cache setToCString: ""];
				[attr_name release];

				last = i + 1;
390
391
392
393
394
395
396






397
398
399
400
401
402
403
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417







+
+
+
+
+
+







	/* In OF_XMLPARSER_IN_TAG, there can be only spaces */
	if (len > 0 && state != OF_XMLPARSER_IN_TAG)
		[cache appendCString: buf + last
			  withLength: len];

	return self;
}

- (OFString*)foundUnknownEntityNamed: (OFString*)entity
{
	return [delegate xmlParser: self
	   foundUnknownEntityNamed: entity];
}
@end

@implementation OFString (OFXMLUnescaping)
- stringByXMLUnescaping
{
	return [self stringByXMLUnescapingWithHandler: nil];
}