1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/*
* Copyright (c) 2008 - 2010
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import "OFObject.h"
#import "OFString.h"
@class OFMutableArray;
@class OFMutableDictionary;
extern int _OFXMLElement_reference;
/**
* \brief A representation of an attribute of an XML element as an object.
*/
@interface OFXMLAttribute: OFObject
{
OFString *name;
OFString *namespace;
OFString *stringValue;
}
#ifdef OF_HAVE_PROPERTIES
@property (readonly, retain) OFString *name;
@property (readonly, retain) OFString *namespace;
@property (readonly, retain) OFString *stringValue;
#endif
/**
* \param name The name of the attribute
* \param ns The namespace of the attribute
* \param value The string value of the attribute
* \return A new autoreleased OFXMLAttribute with the specified parameters
*/
+ attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value;
/**
* Initializes an already allocated OFXMLAttribute.
*
* \param name The name of the attribute
* \param ns The namespace of the attribute
* \param value The string value of the attribute
* \return An initialized OFXMLAttribute with the specified parameters
*/
- initWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value;
/**
* \return The name of the attribute as an autoreleased OFString
*/
- (OFString*)name;
/**
* \return The namespace of the attribute as an autoreleased OFString
*/
- (OFString*)namespace;
/**
* \return The string value of the attribute as an autoreleased OFString
*/
- (OFString*)stringValue;
@end
/**
* \brief A representation of an XML element as an object.
*
* The OFXMLElement represents an XML element as an object which can be
* modified and converted back to XML again.
*/
@interface OFXMLElement: OFObject
{
OFString *name;
OFString *namespace;
OFString *defaultNamespace;
OFMutableArray *attributes;
OFString *stringValue;
|
<
>
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/*
* Copyright (c) 2008 - 2010
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import "OFObject.h"
@class OFString;
@class OFMutableArray;
@class OFMutableDictionary;
@class OFXMLAttribute;
@interface OFXMLElement: OFObject
{
OFString *name;
OFString *namespace;
OFString *defaultNamespace;
OFMutableArray *attributes;
OFString *stringValue;
|
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
/**
* Adds a child to the OFXMLElement.
*
* \param child Another OFXMLElement which is added as a child
*/
- (void)addChild: (OFXMLElement*)child;
@end
/**
* \brief A category to escape strings for use in an XML document.
*/
@interface OFString (OFXMLEscaping)
/**
* Escapes a string for use in an XML document.
*
* \return A new autoreleased string
*/
- (OFString*)stringByXMLEscaping;
@end
|
<
<
<
<
<
<
<
<
<
<
<
<
|
161
162
163
164
165
166
167
|
/**
* Adds a child to the OFXMLElement.
*
* \param child Another OFXMLElement which is added as a child
*/
- (void)addChild: (OFXMLElement*)child;
@end
|