Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -39,12 +39,12 @@ OFString *CDATA; OFString *comment; } #ifdef OF_HAVE_PROPERTIES -@property (readonly, copy) OFString *name; -@property (readonly, copy, getter=namespace) OFString *ns; +@property (copy) OFString *name; +@property (copy, getter=namespace, setter=setNamespace) OFString *ns; @property (copy) OFString *defaultNamespace; @property (readonly, copy) OFArray *attributes; @property (readonly, copy) OFArray *children; #endif @@ -231,15 +231,29 @@ * \param path The path to the file * \return An initialized OFXMLElement with the contents of the specified file */ - initWithFile: (OFString*)path; +/** + * Sets the name of the element. + * + * \param name The new name + */ +- (void)setName: (OFString*)name; + /** * \return The name of the element */ - (OFString*)name; +/** + * Sets the namespace of the element. + * + * \param ns The new namespace + */ +- (void)setNamespace: (OFString*)ns; + /** * \return The namespace of the element */ - (OFString*)namespace; Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -388,15 +388,33 @@ @throw e; } return self; } + +- (void)setName: (OFString*)name_ +{ + if (name == nil) + @throw [OFInvalidArgumentException newWithClass: isa + selector: _cmd]; + + OF_SETTER(name, name_, YES, YES) +} - (OFString*)name { return [[name copy] autorelease]; } + +- (void)setNamespace: (OFString*)ns_ +{ + if (name == nil) + @throw [OFInvalidArgumentException newWithClass: isa + selector: _cmd]; + + OF_SETTER(ns, ns_, YES, YES) +} - (OFString*)namespace { return [[ns copy] autorelease]; }