ObjFW  Check-in [a95ca84f7e]

Overview
Comment:Improve namespace handling.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a95ca84f7e08f58384a078edda53604a028c5c61e939374de1bf490ecaf65765
User & Date: js on 2011-03-10 20:34:37
Other Links: manifest | tags
Context
2011-03-11
12:15
Implement conditions for win32. check-in: b5e6a49dca user: js tags: trunk
2011-03-10
20:34
Improve namespace handling. check-in: a95ca84f7e user: js tags: trunk
19:54
Call C++ constructors and destructors. check-in: 894658f979 user: js tags: trunk
Changes

Modified src/OFXMLElementBuilder.m from [6e4d62017f] to [01d91a18bd].

79
80
81
82
83
84
85
86
87
88
89
90

91
92
93
94


95
96
97
98
99
100
101
				   namespace: ns];

	attrs_c = [attrs cArray];
	attrs_cnt = [attrs count];
	add_attr = [elem methodForSelector: @selector(addAttribute:)];

	for (i = 0; i < attrs_cnt; i++) {
		add_attr(elem, @selector(addAttribute:), attrs_c[i]);

		if ([attrs_c[i] namespace] == nil &&
		    [[attrs_c[i] name] isEqual: @"xmlns"])
			[elem setDefaultNamespace: [attrs_c[i] stringValue]];

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


	}

	[[stack lastObject] addChild: elem];
	[stack addObject: elem];

	[pool release];
}







<
<

|

>
|



>
>







79
80
81
82
83
84
85


86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
				   namespace: ns];

	attrs_c = [attrs cArray];
	attrs_cnt = [attrs count];
	add_attr = [elem methodForSelector: @selector(addAttribute:)];

	for (i = 0; i < attrs_cnt; i++) {


		if ([attrs_c[i] namespace] == nil &&
		    [[attrs_c[i] name] isEqual: @"xmlns"]) {
			[elem setDefaultNamespace: [attrs_c[i] stringValue]];
			continue;
		} else if ([[attrs_c[i] namespace]
		    isEqual: @"http://www.w3.org/2000/xmlns/"])
			[elem setPrefix: [attrs_c[i] name]
			   forNamespace: [attrs_c[i] stringValue]];

		add_attr(elem, @selector(addAttribute:), attrs_c[i]);
	}

	[[stack lastObject] addChild: elem];
	[stack addObject: elem];

	[pool release];
}