@@ -26,13 +26,14 @@ static OF_INLINE OFString* transform_string(OFMutableString *cache, OFObject *handler) { - /* TODO: Support for xml:space */ - - [cache removeLeadingAndTrailingWhitespaces]; + [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) @@ -467,12 +468,11 @@ pool = [[OFAutoreleasePool alloc] init]; attr_ns = namespace_for_prefix( (attrPrefix != nil ? attrPrefix : prefix), namespaces); - attr_val = [cache - stringByXMLUnescapingWithHandler: self]; + attr_val = transform_string(cache, self); if (attrPrefix == nil && [attrName isEqual: @"xmlns"]) { [[namespaces lastObject] setObject: attr_val