Download
TBXML V1.3
XMLBooks V1.3
Features
Added new - (id)initWithXMLFile:(NSString*)aXMLFile Function. You no longer need to pass the extension as a separate parameter.
Added helper methods for instantiating a TBXML object.
Bug Fixes
Added detection of single quotes as well as double quotes
Changed all encoding types to NSUTF8StringEncoding
Fixed string length detection
WARNING
The following functions have been changed from instance methods to class methods
- Code: Select all
+ (NSString*) elementName:(TBXMLElement*)aXMLElement;
+ (NSString*) textForElement:(TBXMLElement*)aXMLElement;
+ (NSString*) valueOfAttributeNamed:(NSString *)aName forElement:(TBXMLElement*)aXMLElement;
+ (NSString*) attributeName:(TBXMLAttribute*)aXMLAttribute;
+ (NSString*) attributeValue:(TBXMLAttribute*)aXMLAttribute;
+ (TBXMLElement*) nextSiblingNamed:(NSString*)aName searchFromElement:(TBXMLElement*)aXMLElement;
+ (TBXMLElement*) childElementNamed:(NSString*)aName parentElement:(TBXMLElement*)aParentXMLElement;
This means you will need to change your code to call these methods as class methods instead of instance methods.
Code written before TBXML version 1.3
- Code: Select all
// Load and parse the books.xml file
TBXML * myTbxmlObject = [[TBXML alloc] initWithXMLFile:@"books" fileExtension:@"xml"];
// If TBXML found a root node, get the root node name
if (myTbxmlObject.rootXMLElement)
NSString * myDocRootNodeName = [myTbxmlObject elementName:myTbxmlObject.rootXMLElement];
// release resources
[myTbxmlObject release];
Code changed after TBXML version 1.3
- Code: Select all
// Load and parse the books.xml file
TBXML * myTbxmlObject = [[TBXML alloc] initWithXMLFile:@"books" fileExtension:@"xml"];
// If TBXML found a root node, get the root node name
if (myTbxmlObject.rootXMLElement)
NSString * myDocRootNodeName = [TBXML elementName:myTbxmlObject.rootXMLElement];
// release resources
[myTbxmlObject release];
