Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -589,14 +589,15 @@ if ((len = *i - *last) > 0) [cache appendCStringWithoutUTF8Checking: buf + *last length: len]; + [cache removeLeadingAndTrailingWhitespaces]; cache_c = [cache cString]; cache_len = [cache cStringLength]; - if ((tmp = memchr(cache_c, ':', cache_len)) != NULL ) { + if ((tmp = memchr(cache_c, ':', cache_len)) != NULL) { attrName = [[OFString alloc] initWithCString: tmp + 1 length: cache_len - (tmp - cache_c) - 1]; attrPrefix = [[OFString alloc] initWithCString: cache_c @@ -615,15 +616,20 @@ /* Expecting delimiter */ - (void)_parseExpectDelimiterWithBuffer: (const char*)buf i: (size_t*)i last: (size_t*)last { + *last = *i + 1; + + if (buf[*i] == ' ' || buf[*i] == '\t' || buf[*i] == '\n' || + buf[*i] == '\r') + return; + if (buf[*i] != '\'' && buf[*i] != '"') @throw [OFMalformedXMLException newWithClass: isa]; delim = buf[*i]; - *last = *i + 1; state = OF_XMLPARSER_IN_ATTR_VALUE; } /* Looking for attribute value */ - (void)_parseInAttributeValueWithBuffer: (const char*)buf