@@ -24,27 +24,27 @@ #import "OFXMLNode+Private.h" #import "OFInvalidArgumentException.h" @implementation OFXMLProcessingInstruction -@synthesize target = _target, data = _data; +@synthesize target = _target, text = _text; + (instancetype)processingInstructionWithTarget: (OFString *)target - data: (OFString *)data + text: (OFString *)text { return [[[self alloc] initWithTarget: target - data: data] autorelease]; + text: text] autorelease]; } - (instancetype)initWithTarget: (OFString *)target - data: (OFString *)data + text: (OFString *)text { self = [super of_init]; @try { _target = [target copy]; - _data = [data copy]; + _text = [text copy]; } @catch (id e) { [self release]; @throw e; } @@ -65,11 +65,11 @@ namespace: OFSerializationNS]; if (targetAttr.stringValue.length == 0) @throw [OFInvalidArgumentException exception]; self = [self initWithTarget: targetAttr.stringValue - data: element.stringValue]; + text: element.stringValue]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; @@ -79,11 +79,11 @@ } - (void)dealloc { [_target release]; - [_data release]; + [_text release]; [super dealloc]; } - (bool)isEqual: (id)object @@ -99,12 +99,12 @@ processingInstruction = object; if (![processingInstruction->_target isEqual: _target]) return false; - if (processingInstruction->_data != _data && - ![processingInstruction->_data isEqual: _data]) + if (processingInstruction->_text != _text && + ![processingInstruction->_text isEqual: _text]) return false; return true; } @@ -112,11 +112,11 @@ { unsigned long hash; OFHashInit(&hash); OFHashAddHash(&hash, _target.hash); - OFHashAddHash(&hash, _data.hash); + OFHashAddHash(&hash, _text.hash); OFHashFinalize(&hash); return hash; } @@ -125,13 +125,13 @@ return @""; } - (OFString *)XMLString { - if (_data.length > 0) + if (_text.length > 0) return [OFString stringWithFormat: @"", - _target, _data]; + _target, _text]; else return [OFString stringWithFormat: @"", _target]; } - (OFString *)XMLStringWithIndentation: (unsigned int)indentation @@ -147,14 +147,14 @@ char *whitespaces = OFAllocMemory((level * indentation) + 1, 1); memset(whitespaces, ' ', level * indentation); whitespaces[level * indentation] = 0; @try { - if (_data.length > 0) + if (_text.length > 0) ret = [OFString stringWithFormat: @"%s", whitespaces, - _target, _data]; + _target, _text]; else ret = [OFString stringWithFormat: @"%s", whitespaces, _target]; } @finally { OFFreeMemory(whitespaces); @@ -172,11 +172,11 @@ - (OFXMLElement *)XMLElementBySerializing { OFXMLElement *ret = [OFXMLElement elementWithName: self.className namespace: OFSerializationNS - stringValue: _data]; + stringValue: _text]; void *pool = objc_autoreleasePoolPush(); [ret addAttribute: [OFXMLAttribute attributeWithName: @"target" stringValue: _target]];