ObjFW
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties
OFXMLElement Class Reference

A class which stores an XML element. More...

#include <OFXMLElement.h>

Inheritance diagram for OFXMLElement:
OFObject <OFObject>

List of all members.

Public Member Functions

id initWithName: (OFString *name)
id initWithName:stringValue: (OFString *name,[stringValue] OFString *stringval)
id initWithName:namespace: (OFString *name,[namespace] OFString *ns)
id initWithName:namespace:stringValue: (OFString *name,[namespace] OFString *ns,[stringValue] OFString *stringval)
id initWithCharacters: (OFString *chars)
id initWithCDATA: (OFString *cdata)
id initWithComment: (OFString *comment)
id initWithXMLString: (OFString *str)
OFStringname ()
OFStringnamespace ()
OFArrayattributes ()
void setChildren: (OFArray *children)
OFArraychildren ()
void setStringValue: (OFString *value)
OFStringstringValue ()
OFStringXMLString ()
void addAttribute: (OFXMLAttribute *attr)
void addAttributeWithName:stringValue: (OFString *name,[stringValue] OFString *value)
void addAttributeWithName:namespace:stringValue: (OFString *name,[namespace] OFString *ns,[stringValue] OFString *value)
OFXMLAttributeattributeForName: (OFString *attrname)
OFXMLAttributeattributeForName:namespace: (OFString *attrname,[namespace] OFString *attrns)
void removeAttributeForName: (OFString *attrname)
void removeAttributeForName:namespace: (OFString *attrname,[namespace] OFString *attrns)
void setPrefix:forNamespace: (OFString *prefix,[forNamespace] OFString *ns)
void bindPrefix:forNamespace: (OFString *prefix,[forNamespace] OFString *ns)
void setDefaultNamespace: (OFString *ns)
void addChild: (OFXMLElement *child)
OFXMLElementelementForName: (OFString *elemname)
OFArrayelementsForName: (OFString *elemname)
OFXMLElementelementForName:namespace: (OFString *elemname,[namespace] OFString *elemns)
OFArrayelementsForName:namespace: (OFString *elemname,[namespace] OFString *elemns)

Static Public Member Functions

id elementWithName: (OFString *name)
id elementWithName:stringValue: (OFString *name,[stringValue] OFString *stringval)
id elementWithName:namespace: (OFString *name,[namespace] OFString *ns)
id elementWithName:namespace:stringValue: (OFString *name,[namespace] OFString *ns,[stringValue] OFString *stringval)
id elementWithCharacters: (OFString *chars)
id elementWithCDATA: (OFString *cdata)
id elementWithComment: (OFString *comment)
id elementWithXMLString: (OFString *str)

Protected Attributes

OFMutableArrayattributes
OFMutableDictionarynamespaces
OFMutableArraychildren
OFStringcharacters
OFStringcdata
OFMutableStringcomment

Properties

OFStringname
OFStringns
OFStringdefaultNamespace
OFArrayattributes
OFArraychildren

Detailed Description

A class which stores an XML element.


Member Function Documentation

void OFXMLElement::addAttribute: ( OFXMLAttribute attr) [virtual]

Adds the specified attribute.

If an attribute with the same name and namespace already exists, it is not added.

Parameters:
attrThe attribute to add
void OFXMLElement::addAttributeWithName:namespace:stringValue: ( OFString name,
[namespace] OFString ns,
[stringValue] OFString value 
) [virtual]

Adds the specified attribute with the specified namespace and value.

If an attribute with the same name and namespace already exists, it is not added.

Parameters:
nameThe name of the attribute
nsThe namespace of the attribute
valueThe value of the attribute
void OFXMLElement::addAttributeWithName:stringValue: ( OFString name,
[stringValue] OFString value 
) [virtual]

Adds the specified attribute with the specified value.

If an attribute with the same name and namespace already exists, it is not added.

Parameters:
nameThe name of the attribute
valueThe value of the attribute
void OFXMLElement::addChild: ( OFXMLElement child) [virtual]

Adds a child to the OFXMLElement.

Parameters:
childAnother OFXMLElement which is added as a child
OFXMLAttribute * OFXMLElement::attributeForName: ( OFString attrname) [virtual]
Parameters:
attrnameThe name of the attribute
Returns:
The attribute with the specified name
OFXMLAttribute * OFXMLElement::attributeForName:namespace: ( OFString attrname,
[namespace] OFString attrns 
) [virtual]
Parameters:
attrnameThe name of the attribute
attrnsThe namespace of the attribute
Returns:
The attribute with the specified name and namespace
OFArray* OFXMLElement::attributes ( ) [virtual]
Returns:
An OFArray with the attributes of the element
void OFXMLElement::bindPrefix:forNamespace: ( OFString prefix,
[forNamespace] OFString ns 
) [virtual]

Binds a prefix for a namespace.

Parameters:
prefixThe prefix for the namespace
nsThe namespace for which the prefix is bound
OFArray* OFXMLElement::children ( ) [virtual]
Returns:
An array with all children of the element
OFXMLElement * OFXMLElement::elementForName: ( OFString elemname) [virtual]
Parameters:
elemnameThe name of the element
Returns:
The first child element with the specified name
OFXMLElement * OFXMLElement::elementForName:namespace: ( OFString elemname,
[namespace] OFString elemns 
) [virtual]
Parameters:
elemnameThe name of the element
elemnsThe namespace of the element
Returns:
The first child element with the specified name and namespace
OFArray * OFXMLElement::elementsForName: ( OFString elemname) [virtual]
Parameters:
elemnameThe name of the elements
Returns:
The child elements with the specified name
OFArray * OFXMLElement::elementsForName:namespace: ( OFString elemname,
[namespace] OFString elemns 
) [virtual]
Parameters:
elemnameThe name of the elements
elemnsThe namespace of the elements
Returns:
The child elements with the specified name and namespace
id OFXMLElement::elementWithCDATA: ( OFString cdata) [static, virtual]

Creates a new element, only consisting of the specified CDATA.

Parameters:
cdataThe CDATA the element represents
Returns:
A new autoreleased OFXMLElement consisting of the specified CDATA
id OFXMLElement::elementWithCharacters: ( OFString chars) [static, virtual]

Creates a new element, only consisting of the specified characters.

Parameters:
charsThe characters the element represents
Returns:
A new autoreleased OFXMLElement consisting of the specified characters
id OFXMLElement::elementWithComment: ( OFString comment) [static, virtual]

Creates a new element, only consisting of the specified comment.

Parameters:
commentThe comment the element represents
Returns:
A new autoreleased OFXMLElement consisting of the specified comment
id OFXMLElement::elementWithName: ( OFString name) [static, virtual]
Parameters:
nameThe name for the element
Returns:
A new autoreleased OFXMLElement with the specified element name
id OFXMLElement::elementWithName:namespace: ( OFString name,
[namespace] OFString ns 
) [static, virtual]
Parameters:
nameThe name for the element
nsThe namespace for the element
Returns:
A new autoreleased OFXMLElement with the specified element name and namespace
id OFXMLElement::elementWithName:namespace:stringValue: ( OFString name,
[namespace] OFString ns,
[stringValue] OFString stringval 
) [static, virtual]
Parameters:
nameThe name for the element
nsThe namespace for the element
stringvalThe value for the element
Returns:
A new autoreleased OFXMLElement with the specified element name, namespace and value
id OFXMLElement::elementWithName:stringValue: ( OFString name,
[stringValue] OFString stringval 
) [static, virtual]
Parameters:
nameThe name for the element
stringvalThe value for the element
Returns:
A new autoreleased OFXMLElement with the specified element name and value
id OFXMLElement::elementWithXMLString: ( OFString str) [static, virtual]

Parses the string and returns an OFXMLElement for it.

Parameters:
strThe string to parse
Returns:
A new autoreleased OFXMLElement with the contents of the string
id OFXMLElement::initWithCDATA: ( OFString cdata) [virtual]

Initializes an already allocated OFXMLElement so that it only consists of the specified CDATA.

Parameters:
cdataThe CDATA the element represents
Returns:
An initialized OFXMLElement consisting of the specified CDATA
id OFXMLElement::initWithCharacters: ( OFString chars) [virtual]

Initializes an already allocated OFXMLElement so that it only consists of the specified characters.

Parameters:
charsThe characters the element represents
Returns:
An initialized OFXMLElement consisting of the specified characters
id OFXMLElement::initWithComment: ( OFString comment) [virtual]

Initializes an already allocated OFXMLElement so that it only consists of the specified comment.

Parameters:
commentThe comment the element represents
Returns:
An initialized OFXMLElement consisting of the specified comment
id OFXMLElement::initWithName: ( OFString name) [virtual]

Initializes an already allocated OFXMLElement with the specified element name.

Parameters:
nameThe name for the element
Returns:
An initialized OFXMLElement with the specified element name
id OFXMLElement::initWithName:namespace: ( OFString name,
[namespace] OFString ns 
) [virtual]

Initializes an already allocated OFXMLElement with the specified element name and namespace.

Parameters:
nameThe name for the element
nsThe namespace for the element
Returns:
An initialized OFXMLElement with the specified element name and namespace
id OFXMLElement::initWithName:namespace:stringValue: ( OFString name,
[namespace] OFString ns,
[stringValue] OFString stringval 
) [virtual]

Initializes an already allocated OFXMLElement with the specified element name, namespace and value.

Parameters:
nameThe name for the element
nsThe namespace for the element
stringvalThe value for the element
Returns:
An initialized OFXMLElement with the specified element name, namespace and value
id OFXMLElement::initWithName:stringValue: ( OFString name,
[stringValue] OFString stringval 
) [virtual]

Initializes an already allocated OFXMLElement with the specified element name and value.

Parameters:
nameThe name for the element
stringvalThe value for the element
Returns:
An initialized OFXMLElement with the specified element name and value
id OFXMLElement::initWithXMLString: ( OFString str) [virtual]

Parses the string and initializes an already allocated OFXMLElement with it.

Parameters:
strThe string to parse
Returns:
An initialized OFXMLElement with the contents of the string
OFString* OFXMLElement::name ( ) [virtual]
Returns:
The name of the element
OFString * OFXMLElement::namespace ( ) [virtual]
Returns:
The namespace of the element
void OFXMLElement::removeAttributeForName: ( OFString attrname) [virtual]

Removes the attribute with the specified name.

Parameters:
attrnameThe name of the attribute
void OFXMLElement::removeAttributeForName:namespace: ( OFString attrname,
[namespace] OFString attrns 
) [virtual]

Removes the attribute with the specified name and namespace.

Parameters:
attrnameThe name of the attribute
attrnsThe namespace of the attribute
void OFXMLElement::setChildren: ( OFArray children) [virtual]

Removes all children and adds the children from the specified array.

Parameters:
childrenThe new children to add
void OFXMLElement::setDefaultNamespace: ( OFString ns) [virtual]

Sets the default namespace for the element to be used if there is no parent.

Parameters:
nsThe default namespace for the element
void OFXMLElement::setPrefix:forNamespace: ( OFString prefix,
[forNamespace] OFString ns 
) [virtual]

Sets a prefix for a namespace.

Parameters:
prefixThe prefix for the namespace
nsThe namespace for which the prefix is set
void OFXMLElement::setStringValue: ( OFString value) [virtual]

Removes all children and sets the string value to the specified string.

Parameters:
valueThe new string value for the element
OFString * OFXMLElement::stringValue ( ) [virtual]
Returns:
A string with the string value of all children concatenated
OFString * OFXMLElement::XMLString ( ) [virtual]
Returns:
A new autoreleased OFString representing the OFXMLElement as an XML string

The documentation for this class was generated from the following files:
 All Classes Functions Variables