︙ | | | ︙ | |
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
stringValue: (OFString*)stringval
{
return [[[self alloc] initWithName: name
namespace: ns
stringValue: stringval] autorelease];
}
+ elementWithText: (OFString*)text
{
return [[[self alloc] initWithText: text] autorelease];
}
+ elementWithComment: (OFString*)comment
{
return [[[self alloc] initWithComment: comment] autorelease];
}
|
|
|
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
stringValue: (OFString*)stringval
{
return [[[self alloc] initWithName: name
namespace: ns
stringValue: stringval] autorelease];
}
+ elementWithCharacters: (OFString*)chars
{
return [[[self alloc] initWithCharacters: chars] autorelease];
}
+ elementWithComment: (OFString*)comment
{
return [[[self alloc] initWithComment: comment] autorelease];
}
|
︙ | | | ︙ | |
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
self = [super init];
name = [name_ copy];
namespace = [ns copy];
if (stringval != nil) {
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];;
[self addChild: [OFXMLElement elementWithText: stringval]];
[pool release];
}
namespaces = [[OFMutableDictionary alloc] initWithKeysAndObjects:
@"http://www.w3.org/XML/1998/namespace", @"xml",
@"http://www.w3.org/2000/xmlns/", @"xmlns", nil];
return self;
}
- initWithText: (OFString*)text_
{
self = [super init];
text = [text_ copy];
return self;
}
- initWithComment: (OFString*)comment_
{
self = [super init];
|
|
>
|
|
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
self = [super init];
name = [name_ copy];
namespace = [ns copy];
if (stringval != nil) {
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];;
[self addChild:
[OFXMLElement elementWithCharacters: stringval]];
[pool release];
}
namespaces = [[OFMutableDictionary alloc] initWithKeysAndObjects:
@"http://www.w3.org/XML/1998/namespace", @"xml",
@"http://www.w3.org/2000/xmlns/", @"xmlns", nil];
return self;
}
- initWithCharacters: (OFString*)chars
{
self = [super init];
characters = [chars copy];
return self;
}
- initWithComment: (OFString*)comment_
{
self = [super init];
|
︙ | | | ︙ | |
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
size_t len, i, j, attrs_count;
OFString *prefix = nil;
OFXMLAttribute **attrs_carray;
OFString *ret, *tmp;
OFMutableDictionary *all_namespaces;
OFString *def_ns;
if (text != nil)
return [text stringByXMLEscaping];
if (comment != nil) {
OFMutableString *str;
str = [OFMutableString stringWithString: @"<!--"];
[str appendString: comment];
[str appendString: @"-->"];
|
|
|
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
size_t len, i, j, attrs_count;
OFString *prefix = nil;
OFXMLAttribute **attrs_carray;
OFString *ret, *tmp;
OFMutableDictionary *all_namespaces;
OFString *def_ns;
if (characters != nil)
return [characters stringByXMLEscaping];
if (comment != nil) {
OFMutableString *str;
str = [OFMutableString stringWithString: @"<!--"];
[str appendString: comment];
[str appendString: @"-->"];
|
︙ | | | ︙ | |
427
428
429
430
431
432
433
434
435
436
437
438
439
|
- (void)dealloc
{
[name release];
[namespace release];
[attributes release];
[namespaces release];
[children release];
[text release];
[comment release];
[super dealloc];
}
@end
|
|
|
428
429
430
431
432
433
434
435
436
437
438
439
440
|
- (void)dealloc
{
[name release];
[namespace release];
[attributes release];
[namespaces release];
[children release];
[characters release];
[comment release];
[super dealloc];
}
@end
|