Posted By

mracoker on 02/05/10


Tagged

xml attribute touchxml


Versions (?)

TouchXML Attribute


 / Published in: Objective C
 

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

  1. 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:
  2.  
  3. //resultElement is a CXMLElement
  4. //attributeForName is a method of CXMLElement which returns a CXMLNode
  5. //stringValue is a method of CXMLNode that returns the string value for attribute by name
  6. [[resultElement attributeForName:@"id"] stringValue];

Report this snippet  

You need to login to post a comment.