ObjFW  Diff

Differences From Artifact [21ba954ddd]:

To Artifact [13948b0a6c]:


86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
-    (void)parser: (OFXMLParser*)parser
  didStartElement: (OFString*)name
       withPrefix: (OFString*)prefix
	namespace: (OFString*)ns
       attributes: (OFArray*)attributes
{
	OFXMLElement *element;
	OFXMLAttribute **cArray;
	size_t i, count;

	element = [OFXMLElement elementWithName: name
				      namespace: ns];

	cArray = [attributes cArray];
	count = [attributes count];

	for (i = 0; i < count; i++) {
		if ([cArray[i] namespace] == nil &&
		    [[cArray[i] name] isEqual: @"xmlns"])
			continue;

		if ([[cArray[i] namespace]
		    isEqual: @"http://www.w3.org/2000/xmlns/"])
			[element setPrefix: [cArray[i] name]
			      forNamespace: [cArray[i] stringValue]];

		[element addAttribute: cArray[i]];
	}

	[[stack lastObject] addChild: element];
	[stack addObject: element];
}

-  (void)parser: (OFXMLParser*)parser







|





|



|
|


|

|
|

|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
-    (void)parser: (OFXMLParser*)parser
  didStartElement: (OFString*)name
       withPrefix: (OFString*)prefix
	namespace: (OFString*)ns
       attributes: (OFArray*)attributes
{
	OFXMLElement *element;
	OFXMLAttribute **objects;
	size_t i, count;

	element = [OFXMLElement elementWithName: name
				      namespace: ns];

	objects = [attributes objects];
	count = [attributes count];

	for (i = 0; i < count; i++) {
		if ([objects[i] namespace] == nil &&
		    [[objects[i] name] isEqual: @"xmlns"])
			continue;

		if ([[objects[i] namespace]
		    isEqual: @"http://www.w3.org/2000/xmlns/"])
			[element setPrefix: [objects[i] name]
			      forNamespace: [objects[i] stringValue]];

		[element addAttribute: objects[i]];
	}

	[[stack lastObject] addChild: element];
	[stack addObject: element];
}

-  (void)parser: (OFXMLParser*)parser