Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -10,10 +10,11 @@ */ #import "OFObject.h" @class OFString; +@class OFArray; @class OFMutableString; @class OFMutableArray; @class OFMutableDictionary; @class OFXMLAttribute; @@ -27,10 +28,18 @@ OFMutableArray *children; OFString *characters; OFString *cdata; OFMutableString *comment; } + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, copy) OFString *name; +@property (readonly, copy) OFString *namespace; +@property (copy) OFString *defaultNamespace; +@property (readonly, copy) OFArray *attributes; +@property (readonly, copy) OFArray *children; +#endif /** * \param name The name for the element * \return A new autoreleased OFXMLElement with the specified element name */ @@ -162,10 +171,30 @@ * \param comment The comment the element represents * \return An initialized OFXMLElement consisting of the specified comment */ - initWithComment: (OFString*)comment; +/** + * \return The name of the element + */ +- (OFString*)name; + +/** + * \return The namespace of the element + */ +- (OFString*)namespace; + +/** + * \return An OFArray with the attributes of the element + */ +- (OFArray*)attributes; + +/** + * \return An array with all children of the element + */ +- (OFArray*)children; + /** * \return A new autoreleased OFString representing the OFXMLElement as an * XML string */ - (OFString*)string; Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -142,10 +142,30 @@ comment = [comment_ copy]; return self; } + +- (OFString*)name +{ + return [[name copy] autorelease]; +} + +- (OFString*)namespace +{ + return [[namespace copy] autorelease]; +} + +- (OFArray*)attributes +{ + return [[attributes copy] autorelease]; +} + +- (OFArray*)children +{ + return [[children copy] autorelease]; +} - (OFString*)_stringWithParentNamespaces: (OFDictionary*)parent_namespaces parentDefaultNamespace: (OFString*)parent_default_ns { OFAutoreleasePool *pool, *pool2;