]> err.no Git - sope/blobdiff - sope-xml/DOM/DOMElement.m
renamed DOM implementations from DOMxx to NGDOMxx
[sope] / sope-xml / DOM / DOMElement.m
index 9712f3f1c3d3b57ad86eada103d3288dee4ded5f..256901c01ed48b558cd040473bed4e10dd771120 100644 (file)
@@ -28,7 +28,7 @@
 
 @interface _DOMElementAttrNamedNodeMap : NSObject < DOMNamedNodeMap >
 {
-  DOMElement *element; /* non-retained */
+  NGDOMElement *element; /* non-retained */
 }
 
 - (id)initWithElement:(id)_element;
@@ -39,7 +39,7 @@
 
 @end /* _DOMElementAttrNamedNodeMap */
 
-@interface DOMElement(Privates)
+@interface NGDOMElement(Privates)
 - (unsigned)_numberOfAttributes;
 - (id)_attributeNodeAtIndex:(unsigned)_idx;
 - (id)attributeNode:(NSString *)_localName;
@@ -48,7 +48,7 @@
 
 static NSNull *null = nil;
 
-@implementation DOMElement
+@implementation NGDOMElement
 
 - (id)initWithTagName:(NSString *)_tagName namespaceURI:(NSString *)_uri {
   if (null == nil)
@@ -132,8 +132,8 @@ static NSNull *null = nil;
 }
 - (id<NSObject,DOMNodeList>)getElementsByTagName:(NSString *)_tagName {
   /* introduced in DOM2, should return a *live* list ! */
-  NSMutableArray        *array;
-  DOMNodePreorderWalker *walker;
+  NGDOMNodePreorderWalker *walker;
+  NSMutableArray *array;
   SEL sel;
   id  ctx;
   
@@ -143,7 +143,7 @@ static NSNull *null = nil;
   if (_tagName == nil)
     return nil;
 
-  array = [NSMutableArray array];
+  array = [NSMutableArray arrayWithCapacity:4];
   
   if ([_tagName isEqualToString:@"*"]) {
     _tagName = nil;
@@ -155,10 +155,8 @@ static NSNull *null = nil;
     sel = @selector(_walk_getElementsByTagName:);
   }
   
-  walker = [[DOMNodePreorderWalker alloc]
-                                   initWithTarget:self
-                                   selector:sel
-                                   context:ctx];
+  walker = [[NGDOMNodePreorderWalker alloc]
+            initWithTarget:self selector:sel context:ctx];
   
   [walker walkNode:self];
 
@@ -511,9 +509,7 @@ static NSNull *null = nil;
                      [self hasChildNodes] ? [[self childNodes] length] : 0];
 }
 
-@end /* DOMElement */
-
-@implementation DOMElement(QPValues)
+/* QPValues */
 
 - (NSException *)setQueryPathValue:(id)_value {
   return [NSException exceptionWithName:@"QueryPathEvalException"
@@ -524,7 +520,7 @@ static NSNull *null = nil;
   return [self childNodes];
 }
 
-@end /* DOMElement(QPValues) */
+@end /* NGDOMElement */
 
 @implementation _DOMElementAttrNamedNodeMap