Re: XML Attributes
Re: XML Attributes
- Subject: Re: XML Attributes
- From: "Mr. Gecko" <email@hidden>
- Date: Sat, 3 May 2008 16:22:41 -0500
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 (email@hidden)
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:
This email sent to email@hidden