@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -18,11 +18,10 @@ #include #import "OFXMLProcessingInstruction.h" #import "OFString.h" #import "OFXMLAttribute.h" -#import "OFXMLElement.h" #import "OFXMLNode+Private.h" #import "OFInvalidArgumentException.h" @implementation OFXMLProcessingInstruction @@ -46,37 +45,10 @@ } @catch (id e) { [self release]; @throw e; } - return self; -} - -- (instancetype)initWithSerialization: (OFXMLElement *)element -{ - @try { - void *pool = objc_autoreleasePoolPush(); - OFXMLAttribute *targetAttr; - - if (![element.name isEqual: self.className] || - ![element.namespace isEqual: OFSerializationNS]) - @throw [OFInvalidArgumentException exception]; - - targetAttr = [element attributeForName: @"target" - namespace: OFSerializationNS]; - if (targetAttr.stringValue.length == 0) - @throw [OFInvalidArgumentException exception]; - - self = [self initWithTarget: targetAttr.stringValue - text: element.stringValue]; - - objc_autoreleasePoolPop(pool); - } @catch (id e) { - [self release]; - @throw e; - } - return self; } - (void)dealloc { @@ -136,21 +108,6 @@ - (OFString *)description { return self.XMLString; } - -- (OFXMLElement *)XMLElementBySerializing -{ - OFXMLElement *ret = [OFXMLElement elementWithName: self.className - namespace: OFSerializationNS - stringValue: _text]; - void *pool = objc_autoreleasePoolPush(); - - [ret addAttribute: [OFXMLAttribute attributeWithName: @"target" - stringValue: _target]]; - - objc_autoreleasePoolPop(pool); - - return ret; -} @end