Return to Snippet

Revision: 23393
at February 5, 2010 14:33 by mracoker


Updated Code
One of the things I need to do is parse XML and I didnt care for the NSXMLParser so I decided to use TouchXML for this. I downloaded the files from google code and included them in my xcode project then followed this tutorial. Next I decided to point the url to my local web server to test a webservice that returns a XML document. All fine and great but I was'nt sure how to get to any of my attributes, so here is how I did it:

//resultElement is a CXMLElement
//attributeForName is a method of CXMLElement which returns a CXMLNode
//stringValue is a method of CXMLNode that returns the string value for attribute by name
[[resultElement attributeForName:@"id"] stringValue];

Revision: 23392
at February 5, 2010 14:31 by mracoker


Initial Code
Here is my first post to my first blog, so I will keep is short N sweet. I am a .net developer who bought an iPhone and had to start developing for it. So I have a simple project in mind that will allow users to upload photos to their personal websites.

One of the things I need to do is parse XML and I didnt care for the NSXMLParser so I decided to use TouchXML for this. I downloaded the files from google code and included them in my xcode project then followed this tutorial. Next I decided to point the url to my local web server to test a webservice that returns a XML document. All fine and great but I was'nt sure how to get to any of my attributes, so here is how I did it:

//resultElement is a CXMLElement
//attributeForName is a method of CXMLElement which returns a CXMLNode
//stringValue is a method of CXMLNode that returns the string value for attribute by name
[[resultElement attributeForName:@"id"] stringValue];

Initial URL
http://allkindsofprogramming.blogspot.com/

Initial Description

                                

Initial Title
TouchXML Attribute

Initial Tags
xml

Initial Language
Objective C