Thanks it works
here is my updated code
NSXMLDocument *xml = [[NSXMLDocument alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.example.com/xmlfile.xml "]] options:NSXMLDocumentTidyXML error:NULL];
NSXMLNode *node = [xml rootElement];
NSString *name = [[(NSXMLElement *)[[node childAtIndex:1] childAtIndex: 0] attributeForName:@"name"] stringValue];
On May 3, 2008, at 3:54 PM, John Calsbeek wrote:

I believe what you've got is an NSXMLElement (you can see this using the -kind method). You just need to cast it as one:

NSXMLElement *node = (NSXMLElement *)[[nodes childAtIndex:1] childAtIndex:0];

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to