24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
int _OFXMLParser_reference;
static OF_INLINE OFString*
transform_string(OFMutableString *cache,
OFObject <OFXMLUnescapingDelegate> *handler)
{
/* TODO: Support for xml:space */
[cache removeLeadingAndTrailingWhitespaces];
return [cache stringByXMLUnescapingWithHandler: handler];
}
static OF_INLINE OFString*
namespace_for_prefix(OFString *prefix, OFArray *namespaces)
{
OFDictionary **carray = [namespaces cArray];
|
|
|
|
>
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
int _OFXMLParser_reference;
static OF_INLINE OFString*
transform_string(OFMutableString *cache,
OFObject <OFXMLUnescapingDelegate> *handler)
{
[cache replaceOccurrencesOfString: @"\r\n"
withString: @"\n"];
[cache replaceOccurrencesOfString: @"\r"
withString: @"\n"];
return [cache stringByXMLUnescapingWithHandler: handler];
}
static OF_INLINE OFString*
namespace_for_prefix(OFString *prefix, OFArray *namespaces)
{
OFDictionary **carray = [namespaces cArray];
|
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
|
[cache appendCString: buf + last
withLength: len];
pool = [[OFAutoreleasePool alloc] init];
attr_ns = namespace_for_prefix(
(attrPrefix != nil ? attrPrefix : prefix),
namespaces);
attr_val = [cache
stringByXMLUnescapingWithHandler: self];
if (attrPrefix == nil &&
[attrName isEqual: @"xmlns"]) {
[[namespaces lastObject]
setObject: attr_val
forKey: @""];
attr_ns = nil;
|
|
<
|
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
|
[cache appendCString: buf + last
withLength: len];
pool = [[OFAutoreleasePool alloc] init];
attr_ns = namespace_for_prefix(
(attrPrefix != nil ? attrPrefix : prefix),
namespaces);
attr_val = transform_string(cache, self);
if (attrPrefix == nil &&
[attrName isEqual: @"xmlns"]) {
[[namespaces lastObject]
setObject: attr_val
forKey: @""];
attr_ns = nil;
|