Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -1156,26 +1156,26 @@ /** * \brief An exception indicating an attempt to use an unbound namespace. */ @interface OFUnboundNamespaceException: OFException { - OFString *namespace; + OFString *ns; OFString *prefix; } #ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *namespace; +@property (readonly, nonatomic, getter=namespace) OFString *ns; @property (readonly, nonatomic) OFString *prefix; #endif /** * \param class_ The class of the object which caused the exception * \param namespace The namespace which is unbound * \return A new unbound namespace exception */ + newWithClass: (Class)class_ - namespace: (OFString*)namespace; + namespace: (OFString*)ns; /** * \param class_ The class of the object which caused the exception * \param prefix The prefix which is unbound * \return A new unbound namespace exception @@ -1189,11 +1189,11 @@ * \param class_ The class of the object which caused the exception * \param namespace The namespace which is unbound * \return An initialized unbound namespace exception */ - initWithClass: (Class)class_ - namespace: (OFString*)namespace; + namespace: (OFString*)ns; /** * Initializes an already allocated unbound namespace failed exception * * \param class_ The class of the object which caused the exception Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -1513,14 +1513,14 @@ } @end @implementation OFUnboundNamespaceException + newWithClass: (Class)class_ - namespace: (OFString*)namespace + namespace: (OFString*)ns { return [[self alloc] initWithClass: class_ - namespace: namespace]; + namespace: ns]; } + newWithClass: (Class)class_ prefix: (OFString*)prefix { @@ -1533,15 +1533,15 @@ @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } - initWithClass: (Class)class_ - namespace: (OFString*)namespace_ + namespace: (OFString*)ns_ { self = [super initWithClass: class_]; - namespace = [namespace_ copy]; + ns = [ns_ copy]; return self; } - initWithClass: (Class)class_ @@ -1554,11 +1554,11 @@ return self; } - (void)dealloc { - [namespace release]; + [ns release]; [prefix release]; [super dealloc]; } @@ -1565,11 +1565,11 @@ - (OFString*)string { if (string != nil) return string; - if (namespace != nil) + if (ns != nil) string = [[OFString alloc] initWithFormat: @"The namespace %s is not bound in class %s", [inClass className]]; else if (prefix != nil) string = [[OFString alloc] initWithFormat: @@ -1579,13 +1579,13 @@ return string; } - (OFString*)namespace { - return namespace; + return ns; } - (OFString*)prefix { return prefix; } @end Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -45,11 +45,11 @@ * * \param old The object to replace * \param new The replacement object */ - (void)replaceObject: (id)old - withObject: (id)new; + withObject: (id)new_; /** * Replaces the object at the specified index with the specified object. * * \param index The index of the object to replace @@ -65,11 +65,11 @@ * * \param old The object to replace * \param new The replacement object */ - (void)replaceObjectIdenticalTo: (id)old - withObject: (id)new; + withObject: (id)new_; /** * Removes all objects equivalent to the specified object. * * \param obj The object to remove Index: src/OFXMLAttribute.h ================================================================== --- src/OFXMLAttribute.h +++ src/OFXMLAttribute.h @@ -18,17 +18,17 @@ */ @interface OFXMLAttribute: OFObject { @public OFString *name; - OFString *namespace; + OFString *ns; OFString *stringValue; } #ifdef OF_HAVE_PROPERTIES @property (readonly, retain) OFString *name; -@property (readonly, retain) OFString *namespace; +@property (readonly, retain, getter=namespace) OFString *ns; @property (readonly, retain) OFString *stringValue; #endif /** * \param name The name of the attribute Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -24,26 +24,26 @@ namespace: ns stringValue: value] autorelease]; } - initWithName: (OFString*)name_ - namespace: (OFString*)ns + namespace: (OFString*)ns_ stringValue: (OFString*)value { self = [super init]; name = [name_ copy]; - namespace = [ns copy]; + ns = [ns_ copy]; stringValue = [value copy]; return self; } - (void)dealloc { [name release]; - [namespace release]; + [ns release]; [stringValue release]; [super dealloc]; } @@ -52,13 +52,13 @@ return [[name copy] autorelease]; } - (OFString*)namespace { - return [[namespace copy] autorelease]; + return [[ns copy] autorelease]; } - (OFString*)stringValue { return [[stringValue copy] autorelease]; } @end Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -19,11 +19,11 @@ @class OFXMLAttribute; @interface OFXMLElement: OFObject { OFString *name; - OFString *namespace; + OFString *ns; OFString *defaultNamespace; OFMutableArray *attributes; OFMutableDictionary *namespaces; OFMutableArray *children; OFString *characters; @@ -31,11 +31,11 @@ OFMutableString *comment; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; -@property (readonly, copy) OFString *namespace; +@property (readonly, copy, getter=namespace) OFString *ns; @property (copy) OFString *defaultNamespace; @property (readonly, copy) OFArray *attributes; @property (readonly, copy) OFArray *children; #endif Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -86,25 +86,25 @@ namespace: nil stringValue: stringval]; } - initWithName: (OFString*)name_ - namespace: (OFString*)ns + namespace: (OFString*)ns_ { return [self initWithName: name_ - namespace: ns + namespace: ns_ stringValue: nil]; } - initWithName: (OFString*)name_ - namespace: (OFString*)ns + namespace: (OFString*)ns_ stringValue: (OFString*)stringval { self = [super init]; name = [name_ copy]; - namespace = [ns copy]; + ns = [ns_ copy]; if (stringval != nil) { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];; [self addChild: [OFXMLElement elementWithCharacters: stringval]]; @@ -150,11 +150,11 @@ return [[name copy] autorelease]; } - (OFString*)namespace { - return [[namespace copy] autorelease]; + return [[ns copy] autorelease]; } - (OFArray*)attributes { return [[attributes copy] autorelease]; @@ -217,19 +217,16 @@ str_c = [self allocMemoryWithSize: len]; /* Start of tag */ str_c[i++] = '<'; - if ((namespace == nil && def_ns != nil) || - (namespace != nil && def_ns == nil) || - (namespace != nil && ![namespace isEqual: def_ns])) { + if ((ns == nil && def_ns != nil) || (ns != nil && def_ns == nil) || + (ns != nil && ![ns isEqual: def_ns])) { if ((prefix = [all_namespaces objectForKey: - (namespace != nil ? namespace : (OFString*)@"")]) == nil) - @throw [OFUnboundNamespaceException - newWithClass: isa - namespace: namespace]; - + (ns != nil ? ns : (OFString*)@"")]) == nil) + @throw [OFUnboundNamespaceException newWithClass: isa + namespace: ns]; len += [prefix cStringLength] + 1; @try { str_c = [self resizeMemory: str_c toSize: len]; } @catch (OFException *e) { @@ -394,11 +391,11 @@ stringValue: value]]; [pool release]; } - (void)addAttributeWithName: (OFString*)name_ - namespace: (OFString*)ns + namespace: (OFString*)ns_ stringValue: (OFString*)value { OFAutoreleasePool *pool; if (name == nil) @@ -405,39 +402,39 @@ @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; pool = [[OFAutoreleasePool alloc] init]; [self addAttribute: [OFXMLAttribute attributeWithName: name_ - namespace: ns + namespace: ns_ stringValue: value]]; [pool release]; } /* TODO: Replace attribute */ /* TODO: Remove attribute */ - (void)setPrefix: (OFString*)prefix - forNamespace: (OFString*)ns + forNamespace: (OFString*)ns_ { if (name == nil || prefix == nil || [prefix isEqual: @""]) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; - if (ns == nil) - ns = @""; + if (ns_ == nil) + ns_ = @""; [namespaces setObject: prefix - forKey: ns]; + forKey: ns_]; } - (void)bindPrefix: (OFString*)prefix - forNamespace: (OFString*)ns + forNamespace: (OFString*)ns_ { [self setPrefix: prefix - forNamespace: ns]; + forNamespace: ns_]; [self addAttributeWithName: prefix namespace: @"http://www.w3.org/2000/xmlns/" - stringValue: ns]; + stringValue: ns_]; } - (OFString*)defaultNamespace { if (name == nil) @@ -445,26 +442,26 @@ selector: _cmd]; return [[defaultNamespace retain] autorelease]; } -- (void)setDefaultNamespace: (OFString*)ns +- (void)setDefaultNamespace: (OFString*)ns_ { if (name == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; OFString *old = defaultNamespace; - defaultNamespace = [ns copy]; + defaultNamespace = [ns_ copy]; [old release]; } -- (void)bindDefaultNamespace: (OFString*)ns +- (void)bindDefaultNamespace: (OFString*)ns_ { - [self setDefaultNamespace: ns]; + [self setDefaultNamespace: ns_]; [self addAttributeWithName: @"xmlns" - stringValue: ns]; + stringValue: ns_]; } - (void)addChild: (OFXMLElement*)child { if (name == nil) @@ -478,11 +475,11 @@ } - (void)dealloc { [name release]; - [namespace release]; + [ns release]; [attributes release]; [namespaces release]; [children release]; [characters release]; [cdata release]; Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -56,11 +56,11 @@ static OF_INLINE void resolve_attr_namespace(OFXMLAttribute *attr, OFString *prefix, OFString *ns, OFArray *namespaces, Class isa) { OFString *attr_ns; - OFString *attr_prefix = attr->namespace; + OFString *attr_prefix = attr->ns; if (attr_prefix == nil) return; attr_ns = namespace_for_prefix(attr_prefix, namespaces); @@ -67,12 +67,12 @@ if ((attr_prefix != nil && attr_ns == nil)) @throw [OFUnboundNamespaceException newWithClass: isa prefix: attr_prefix]; - [attr->namespace release]; - attr->namespace = [attr_ns retain]; + [attr->ns release]; + attr->ns = [attr_ns retain]; } @implementation OFXMLParser + parser {