Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
 All Classes Functions Variables Properties Pages
Instance Methods | Class Methods | Properties | List of all members
INXMLNode Class Reference

A class to represent one node in an XML document. More...

#import <INXMLNode.h>

Inherits NSObject.

Inherited by INXMLReport.

Instance Methods

(void) - addChild:
 Add a child node. More...
 
(id) - attr:
 A shortcut to get the object representing the attribute with the given name. More...
 
(BOOL) - boolAttr:
 Tries to interpret an attribute as a bool value. More...
 
(BOOL) - boolValue
 Returns a boolean value by interpreting the text content. More...
 
(INXMLNode *) - childNamed:
 Returns the first child node matching the given name. More...
 
(NSArray *) - childrenNamed:
 Searches child nodes for a node with given name. More...
 
(NSString *) - childXML
 
(INXMLNode *) - firstChild
 Return the first child node or nil, if there are none. More...
 
(NSNumber *) - numAttr:
 Returns the attribute as an NSNumber. More...
 
(void) - setAttr:forKey:
 Sets an attribute. More...
 
(NSString *) - xml
 

Class Methods

(INXMLNode *) + nodeWithName:
 Returns an empty node with given node name. More...
 
(INXMLNode *) + nodeWithName:attributes:
 Returns a node with given name and attributes. More...
 

Properties

NSMutableDictionary * attributes
 
NSMutableArray * children
 
NSString * name
 
INXMLNodeparent
 
NSString * text
 

Detailed Description

A class to represent one node in an XML document.

Method Documentation

- (void) addChild: (INXMLNode *)  aNode

Add a child node.

- (id) attr: (NSString *)  attributeName

A shortcut to get the object representing the attribute with the given name.

- (BOOL) boolAttr: (NSString *)  attributeName

Tries to interpret an attribute as a bool value.

Returns NO if the attribute:

  • is missing
  • is empty
  • reads "null", "0", "false" or "no"
- (BOOL) boolValue

Returns a boolean value by interpreting the text content.

Any form of "true", "yes" and 1 returns a YES, everything else a NO

- (INXMLNode *) childNamed: (NSString *)  childName

Returns the first child node matching the given name.

Only the direct child nodes are checked, no deep searching is performed.

- (NSArray *) childrenNamed: (NSString *)  childName

Searches child nodes for a node with given name.

Only the direct child nodes are checked, no deep searching is performed.

Returns
Returns an array with nodes matching the name, nil otherwise
- (NSString *) childXML
- (INXMLNode *) firstChild

Return the first child node or nil, if there are none.

+ (INXMLNode *) nodeWithName: (NSString *)  aName

Returns an empty node with given node name.

+ (INXMLNode *) nodeWithName: (NSString *)  aName
attributes: (NSDictionary *)  attributes 

Returns a node with given name and attributes.

- (NSNumber *) numAttr: (NSString *)  attributeName

Returns the attribute as an NSNumber.

If the value is not numeric you will probably get what you deserve.

- (void) setAttr: (NSString *)  attrValue
forKey: (NSString *)  attrKey 

Sets an attribute.

- (NSString *) xml

Property Documentation

- (NSMutableDictionary*) attributes
readwritenonatomicstrong
- (NSMutableArray*) children
readwritenonatomicstrong
- (NSString*) name
readwritenonatomiccopy
- (INXMLNode*) parent
readwritenonatomicassign
- (NSString*) text
readwritenonatomiccopy

The documentation for this class was generated from the following files: