@@ -432,22 +432,22 @@ - (OFString*)stringValue { OFAutoreleasePool *pool; OFMutableString *ret; - OFXMLElement **cArray; + OFXMLElement **objects; size_t i, count = [children count]; if (count == 0) return @""; ret = [OFMutableString string]; - cArray = [children cArray]; + objects = [children objects]; pool = [[OFAutoreleasePool alloc] init]; for (i = 0; i < count; i++) { - [ret appendString: [cArray[i] stringValue]]; + [ret appendString: [objects[i] stringValue]]; [pool releaseObjects]; } [ret makeImmutable]; @@ -463,11 +463,11 @@ { OFAutoreleasePool *pool, *pool2; char *cString; size_t length, i, j, attributesCount; OFString *prefix, *parentPrefix; - OFXMLAttribute **attributesCArray; + OFXMLAttribute **attributesObjects; OFString *ret; OFString *defaultNS; pool = [[OFAutoreleasePool alloc] init]; @@ -549,26 +549,26 @@ i += [ns UTF8StringLength]; cString[i++] = '\''; } /* Attributes */ - attributesCArray = [attributes cArray]; + attributesObjects = [attributes objects]; attributesCount = [attributes count]; pool2 = [[OFAutoreleasePool alloc] init]; for (j = 0; j < attributesCount; j++) { - OFString *attributeName = [attributesCArray[j] name]; + OFString *attributeName = [attributesObjects[j] name]; OFString *attributePrefix = nil; OFString *tmp = - [[attributesCArray[j] stringValue] stringByXMLEscaping]; + [[attributesObjects[j] stringValue] stringByXMLEscaping]; - if ([attributesCArray[j] namespace] != nil && + if ([attributesObjects[j] namespace] != nil && (attributePrefix = [allNamespaces objectForKey: - [attributesCArray[j] namespace]]) == nil) + [attributesObjects[j] namespace]]) == nil) @throw [OFUnboundNamespaceException exceptionWithClass: isa - namespace: [attributesCArray[j] + namespace: [attributesObjects[j] namespace]]; length += [attributeName UTF8StringLength] + (attributePrefix != nil ? [attributePrefix UTF8StringLength] + 1 : 0) + @@ -601,21 +601,22 @@ [pool2 releaseObjects]; } /* Childen */ if (children != nil) { - OFXMLElement **childrenCArray = [children cArray]; + OFXMLElement **childrenObjects = [children objects]; size_t childrenCount = [children count]; OFDataArray *tmp = [OFDataArray dataArray]; BOOL indent; if (indentation > 0) { indent = YES; for (j = 0; j < childrenCount; j++) { - if (childrenCArray[j]->isa == charactersClass || - childrenCArray[j]->isa == CDATAClass) { + if ([childrenObjects[j] isKindOfClass: + charactersClass] || [childrenObjects[j] + isKindOfClass: CDATAClass]) { indent = NO; break; } } } else @@ -626,19 +627,19 @@ unsigned int ind = (indent ? indentation : 0); if (ind) [tmp addItem: "\n"]; - if ([childrenCArray[j] isKindOfClass: + if ([childrenObjects[j] isKindOfClass: [OFXMLElement class]]) - child = [childrenCArray[j] + child = [childrenObjects[j] _XMLStringWithParent: self namespaces: allNamespaces indentation: ind level: level + 1]; else - child = [childrenCArray[j] + child = [childrenObjects[j] XMLStringWithIndentation: ind level: level + 1]; [tmp addNItems: [child UTF8StringLength] fromCArray: [child UTF8String]]; @@ -827,49 +828,49 @@ [pool release]; } - (OFXMLAttribute*)attributeForName: (OFString*)attributeName { - OFXMLAttribute **cArray = [attributes cArray]; + OFXMLAttribute **objects = [attributes objects]; size_t i, count = [attributes count]; for (i = 0; i < count; i++) - if (cArray[i]->ns == nil && - [cArray[i]->name isEqual: attributeName]) - return cArray[i]; + if (objects[i]->ns == nil && + [objects[i]->name isEqual: attributeName]) + return objects[i]; return nil; } - (OFXMLAttribute*)attributeForName: (OFString*)attributeName namespace: (OFString*)attributeNS { - OFXMLAttribute **cArray; + OFXMLAttribute **objects; size_t i, count; if (attributeNS == nil) return [self attributeForName: attributeName]; - cArray = [attributes cArray]; + objects = [attributes objects]; count = [attributes count]; for (i = 0; i < count; i++) - if ([cArray[i]->ns isEqual: attributeNS] && - [cArray[i]->name isEqual: attributeName]) - return cArray[i]; + if ([objects[i]->ns isEqual: attributeNS] && + [objects[i]->name isEqual: attributeName]) + return objects[i]; return nil; } - (void)removeAttributeForName: (OFString*)attributeName { - OFXMLAttribute **cArray = [attributes cArray]; + OFXMLAttribute **objects = [attributes objects]; size_t i, count = [attributes count]; for (i = 0; i < count; i++) { - if (cArray[i]->ns == nil && - [cArray[i]->name isEqual: attributeName]) { + if (objects[i]->ns == nil && + [objects[i]->name isEqual: attributeName]) { [attributes removeObjectAtIndex: i]; return; } } @@ -876,22 +877,22 @@ } - (void)removeAttributeForName: (OFString*)attributeName namespace: (OFString*)attributeNS { - OFXMLAttribute **cArray; + OFXMLAttribute **objects; size_t i, count; if (attributeNS == nil) return [self removeAttributeForName: attributeName]; - cArray = [attributes cArray]; + objects = [attributes objects]; count = [attributes count]; for (i = 0; i < count; i++) { - if ([cArray[i]->ns isEqual: attributeNS] && - [cArray[i]->name isEqual: attributeName]) { + if ([objects[i]->ns isEqual: attributeNS] && + [objects[i]->name isEqual: attributeName]) { [attributes removeObjectAtIndex: i]; return; } } } @@ -963,50 +964,50 @@ } - (OFArray*)elements { OFMutableArray *ret = [OFMutableArray array]; - OFXMLElement **cArray = [children cArray]; + OFXMLElement **objects = [children objects]; size_t i, count = [children count]; for (i = 0; i < count; i++) - if ([cArray[i] isKindOfClass: [OFXMLElement class]]) - [ret addObject: cArray[i]]; + if ([objects[i] isKindOfClass: [OFXMLElement class]]) + [ret addObject: objects[i]]; [ret makeImmutable]; return ret; } - (OFArray*)elementsForName: (OFString*)elementName { OFMutableArray *ret = [OFMutableArray array]; - OFXMLElement **cArray = [children cArray]; + OFXMLElement **objects = [children objects]; size_t i, count = [children count]; for (i = 0; i < count; i++) - if ([cArray[i] isKindOfClass: [OFXMLElement class]] && - cArray[i]->ns == nil && - [cArray[i]->name isEqual: elementName]) - [ret addObject: cArray[i]]; + if ([objects[i] isKindOfClass: [OFXMLElement class]] && + objects[i]->ns == nil && + [objects[i]->name isEqual: elementName]) + [ret addObject: objects[i]]; [ret makeImmutable]; return ret; } - (OFArray*)elementsForNamespace: (OFString*)elementNS { OFMutableArray *ret = [OFMutableArray array]; - OFXMLElement **cArray = [children cArray]; + OFXMLElement **objects = [children objects]; size_t i, count = [children count]; for (i = 0; i < count; i++) - if ([cArray[i] isKindOfClass: [OFXMLElement class]] && - cArray[i]->name != nil && - [cArray[i]->ns isEqual: elementNS]) - [ret addObject: cArray[i]]; + if ([objects[i] isKindOfClass: [OFXMLElement class]] && + objects[i]->name != nil && + [objects[i]->ns isEqual: elementNS]) + [ret addObject: objects[i]]; [ret makeImmutable]; return ret; } @@ -1013,25 +1014,25 @@ - (OFArray*)elementsForName: (OFString*)elementName namespace: (OFString*)elementNS { OFMutableArray *ret; - OFXMLElement **cArray; + OFXMLElement **objects; size_t i, count; if (elementNS == nil) return [self elementsForName: elementName]; ret = [OFMutableArray array]; - cArray = [children cArray]; + objects = [children objects]; count = [children count]; for (i = 0; i < count; i++) - if ([cArray[i] isKindOfClass: [OFXMLElement class]] && - [cArray[i]->ns isEqual: elementNS] && - [cArray[i]->name isEqual: elementName]) - [ret addObject: cArray[i]]; + if ([objects[i] isKindOfClass: [OFXMLElement class]] && + [objects[i]->ns isEqual: elementNS] && + [objects[i]->name isEqual: elementName]) + [ret addObject: objects[i]]; [ret makeImmutable]; return ret; }