0

On my iOS app I am trying to find out if a node exists or not in the XML data. I am trying to use

+ (GDataXMLElement *)elementWithName:(NSString *)name expecting it will return a nil if the node is not present but it does not seem to work.

One option is to convert the XML string into a dictionary and search for the key. But is there a way to skip the Dictionary conversion.

Thanks!

shshnk
  • 1,621
  • 14
  • 26

1 Answers1

0

Finally got it working by using this

GDataXMLElement *abc = (GDataXMLElement *)parentNode;
NSArray *tempArray = [abc elementsForName:childNode ];
return [tempArray count];

Please let me know if there are any other ways of doing this.

shshnk
  • 1,621
  • 14
  • 26