@@ -14,28 +14,87 @@ #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