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
|
#import "OFObject.h"
#import "OFString.h"
#import "OFDictionary.h"
#import "OFArray.h"
extern int _OFXMLElement_reference;
@interface OFXMLElement: OFObject
{
OFString *name;
OFDictionary *attrs;
OFString *stringval;
OFArray *children;
}
+ elementWithName: (OFString*)name;
+ elementWithName: (OFString*)name
andStringValue: (OFString*)stringval;
- initWithName: (OFString*)name;
- initWithName: (OFString*)name
andStringValue: (OFString*)stringval;
- (OFString*)string;
- addAttributeWithName: (OFString*)name
andValue: (OFString*)value;
- addChild: (OFXMLElement*)child;
@end
@interface OFString (OFXMLEscaping)
- stringByXMLEscaping;
@end
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
#import "OFObject.h"
#import "OFString.h"
#import "OFDictionary.h"
#import "OFArray.h"
extern int _OFXMLElement_reference;
/**
* The OFXMLElement represents an XML element as an object which can be
* modified and converted back to XML again.
*/
@interface OFXMLElement: OFObject
{
OFString *name;
OFDictionary *attrs;
OFString *stringval;
OFArray *children;
}
/**
* \param name The name for the element
* \return A new autorelease OFXMLElement with the specified element name
*/
+ elementWithName: (OFString*)name;
/**
* \param name The name for the element
* \param stringval The value for the element
* \return A new autorelease OFXMLElement with the specified element name and
* value
*/
+ elementWithName: (OFString*)name
andStringValue: (OFString*)stringval;
/**
* Initializes an already allocated OFXMLElement with the specified name.
*
* \param name The name for the element
* \return An initialized OFXMLElement with the specified element name
*/
- initWithName: (OFString*)name;
/**
* Initializes an already allocated OFXMLElement with the specified name and
* value.
*
* \param name The name for the element
* \param stringval The value for the element
* \return An initialized OFXMLElement with the specified element name and
* value
*/
- initWithName: (OFString*)name
andStringValue: (OFString*)stringval;
/**
* \return A new autoreleased OFString representing the OFXMLElement as an
* XML string
*/
- (OFString*)string;
/**
* Adds the specified attribute with the specified value.
*
* \param name The name of the attribute
* \param value The value of the attribute
*/
- addAttributeWithName: (OFString*)name
andValue: (OFString*)value;
/**
* Adds a child to the OFXMLElement.
*
* \param child Another OFXMLElement which is added as a child
*/
- addChild: (OFXMLElement*)child;
@end
/**
* The OFXMLEscaping category provides an easy way 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
*/
- stringByXMLEscaping;
@end
|