@@ -125,13 +125,12 @@ attributeNS = namespace_for_prefix(attributePrefix, namespaces); if ((attributePrefix != nil && attributeNS == nil)) @throw [OFUnboundPrefixException - exceptionWithClass: [self class] - prefix: attributePrefix - parser: self]; + exceptionWithPrefix: attributePrefix + parser: self]; [attribute->_namespace release]; attribute->_namespace = [attributeNS retain]; } @@ -322,12 +321,11 @@ _state = OF_XMLPARSER_OUTSIDE_TAG; _i--; return; } - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; } if (_level++ == 2) _state = OF_XMLPARSER_OUTSIDE_TAG; @@ -340,12 +338,11 @@ size_t length; if ((_finishedParsing || [_previous count] < 1) && _data[_i] != ' ' && _data[_i] != '\t' && _data[_i] != '\n' && _data[_i] != '\r' && _data[_i] != '<') - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; if (_data[_i] != '<') return; if ((length = _i - _last) > 0) @@ -371,12 +368,11 @@ /* Tag was just opened */ - (void)OF_tagOpenedState { if (_finishedParsing && _data[_i] != '!' && _data[_i] != '?') - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; switch (_data[_i]) { case '?': _last = _i + 1; _state = OF_XMLPARSER_IN_PROCESSING_INSTRUCTIONS; @@ -393,12 +389,11 @@ _acceptProlog = false; break; default: if (_depthLimit > 0 && [_previous count] >= _depthLimit) @throw [OFMalformedXMLException - exceptionWithClass: [self class] - parser: self]; + exceptionWithParser: self]; _state = OF_XMLPARSER_IN_TAG_NAME; _acceptProlog = false; _i--; break; @@ -522,12 +517,11 @@ if ([PI isEqual: @"xml"] || [PI hasPrefix: @"xml "] || [PI hasPrefix: @"xml\t"] || [PI hasPrefix: @"xml\r"] || [PI hasPrefix: @"xml\n"]) if (![self OF_parseXMLProcessingInstructions: PI]) @throw [OFMalformedXMLException - exceptionWithClass: [self class] - parser: self]; + exceptionWithParser: self]; if ([_delegate respondsToSelector: @selector(parser:foundProcessingInstructions:)]) [_delegate parser: self foundProcessingInstructions: PI]; @@ -582,13 +576,12 @@ namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) @throw [OFUnboundPrefixException - exceptionWithClass: [self class] - prefix: _prefix - parser: self]; + exceptionWithPrefix: _prefix + parser: self]; if ([_delegate respondsToSelector: @selector(parser: didStartElement:prefix:namespace:attributes:)]) [_delegate parser: self didStartElement: _name @@ -662,23 +655,20 @@ _name = [bufferString copy]; _prefix = nil; } if (![[_previous lastObject] isEqual: bufferString]) - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; [_previous removeLastObject]; [_buffer removeAllItems]; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) - @throw [OFUnboundPrefixException - exceptionWithClass: [self class] - prefix: _prefix - parser: self]; + @throw [OFUnboundPrefixException exceptionWithPrefix: _prefix + parser: self]; if ([_delegate respondsToSelector: @selector(parser:didEndElement:prefix:namespace:)]) [_delegate parser: self didEndElement: _name @@ -724,14 +714,12 @@ attributesCount = [_attributes count]; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) - @throw [OFUnboundPrefixException - exceptionWithClass: [self class] - prefix: _prefix - parser: self]; + @throw [OFUnboundPrefixException exceptionWithPrefix: _prefix + parser: self]; for (j = 0; j < attributesCount; j++) resolve_attribute_namespace(attributesObjects[j], _namespaces, self); @@ -831,12 +819,11 @@ if (_data[_i] == ' ' || _data[_i] == '\t' || _data[_i] == '\n' || _data[_i] == '\r') return; if (_data[_i] != '\'' && _data[_i] != '"') - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; _delimiter = _data[_i]; _state = OF_XMLPARSER_IN_ATTR_VALUE; } @@ -884,12 +871,11 @@ { if (_data[_i] == '>') { _last = _i + 1; _state = OF_XMLPARSER_OUTSIDE_TAG; } else - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; } /* Expecting closing '>' or space */ - (void)OF_expectSpaceOrCloseState { @@ -896,20 +882,18 @@ if (_data[_i] == '>') { _last = _i + 1; _state = OF_XMLPARSER_OUTSIDE_TAG; } else if (_data[_i] != ' ' && _data[_i] != '\t' && _data[_i] != '\n' && _data[_i] != '\r') - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; } /* In ') - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; pool = objc_autoreleasePoolPush(); buffer_append(_buffer, _data + _last, _encoding, _i - _last); comment = transform_string(_buffer, 2, false, nil); @@ -1032,12 +1012,11 @@ - (void)OF_inDOCTYPEState { if ((_level < 6 && _data[_i] != "OCTYPE"[_level]) || (_level == 6 && _data[_i] != ' ' && _data[_i] != '\t' && _data[_i] != '\n' && _data[_i] != '\r')) - @throw [OFMalformedXMLException exceptionWithClass: [self class] - parser: self]; + @throw [OFMalformedXMLException exceptionWithParser: self]; _level++; if (_level > 6 && _data[_i] == '>') _state = OF_XMLPARSER_OUTSIDE_TAG;