Index: src/OFXMLAttribute.h ================================================================== --- src/OFXMLAttribute.h +++ src/OFXMLAttribute.h @@ -34,11 +34,10 @@ # ifdef __cplusplus @property (readonly, copy, getter=namespace) OFString *namespace_; # else @property (readonly, copy) OFString *namespace; # endif -@property (readonly, copy) OFString *stringValue; #endif /*! * @brief Creates a new XML attribute. * Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -115,11 +115,18 @@ OF_GETTER(_namespace, true) } - (OFString*)stringValue { - OF_GETTER(_stringValue, true) + return [[_stringValue copy] autorelease]; +} + +- (void)setStringValue: (OFString*)stringValue +{ + OFString *old = _stringValue; + _stringValue = [stringValue copy]; + [old release]; } - (bool)isEqual: (id)object { OFXMLAttribute *attribute; Index: src/OFXMLCDATA.m ================================================================== --- src/OFXMLCDATA.m +++ src/OFXMLCDATA.m @@ -92,10 +92,17 @@ - (OFString*)stringValue { return [[_CDATA copy] autorelease]; } + +- (void)setStringValue: (OFString*)stringValue +{ + OFString *old = _CDATA; + _CDATA = [stringValue copy]; + [old release]; +} - (OFString*)XMLString { /* FIXME: What to do about ]]>? */ return [OFString stringWithFormat: @"", _CDATA]; Index: src/OFXMLCharacters.m ================================================================== --- src/OFXMLCharacters.m +++ src/OFXMLCharacters.m @@ -92,10 +92,17 @@ - (OFString*)stringValue { return [[_characters copy] autorelease]; } + +- (void)setStringValue: (OFString*)stringValue +{ + OFString *old = _characters; + _characters = [stringValue copy]; + [old release]; +} - (OFString*)XMLString { return [_characters stringByXMLEscaping]; } Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -243,18 +243,10 @@ * * @return An array of OFXMLNodes with all children of the element */ - (OFArray*)children; -/*! - * @brief Removes all children and sets the string value to the specified - * string. - * - * @param stringValue The new string value for the element - */ -- (void)setStringValue: (OFString*)stringValue; - /*! * @brief Adds the specified attribute. * * If an attribute with the same name and namespace already exists, it is not * added. Index: src/OFXMLNode.h ================================================================== --- src/OFXMLNode.h +++ src/OFXMLNode.h @@ -28,10 +28,20 @@ * * @return A string with the string value */ - (OFString*)stringValue; +/*! + * @brief Sets the string value of the receiver to the specified string. + * + * For an @ref OFXMLElement, it removes all children and creates a single child + * with the specified string value. + * + * @param stringValue The new string value for the node + */ +- (void)setStringValue: (OFString*)stringValue; + /*! * @brief Returns the contents of the receiver as a decimal value. * * @return An integer with the decimal value */ Index: src/OFXMLNode.m ================================================================== --- src/OFXMLNode.m +++ src/OFXMLNode.m @@ -27,10 +27,15 @@ OF_INVALID_INIT_METHOD } - (OFString*)stringValue { + OF_UNRECOGNIZED_SELECTOR +} + +- (void)setStringValue: (OFString*)stringValue +{ OF_UNRECOGNIZED_SELECTOR } - (intmax_t)decimalValue {