Re: referencing XML Data
Re: referencing XML Data
- Subject: Re: referencing XML Data
- From: Amy Heavey <email@hidden>
- Date: Tue, 16 Sep 2008 20:24:42 +0100
Thanks,
I've been messing about with code all over the place, gone a little
blind I think,
however, I now get 2 errors on this line:
1 - nested functions are disabled, use -fnested-functions to renable
2 - syntax error before in
NSArray *customerArray = [custdoc nodesForXPath:@".//customer"
error:nil];
if ([customerArray count]) {
for (NSXMLNode *customerNode in customerArray) {
NSArray *firstNameArray = [[customerNode nodesForXPath:@".//
first_name" error:nil];
if ([firstNameArray count]) {
NSString *firstNameString = [[firstNameArray objectAtIndex:0]
stringValue];
// do something with the first name string
NSLog(@"First name = %@", firstNameString);
}
// get other strings
// do something with the other strings
}
}
Many Thanks
Amy
On 16 Sep 2008, at 19:52, Sherm Pendley wrote:
NSArray *customerArray = [custdoc nodesForXPath:@".//customer"
error:nil];
if ([customerArray count]){
NSXMLNode *customerNode;
for (customerNode in customerArray) {
error: parse error before 'in'
That should be:
for (NSXMLNode *customerNode in customerArray) {
_______________________________________________
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