Re: referencing XML Data

2008-09-16 Thread Amy Heavey
I've just tried this again, I just changed the start: void import( NSArray *array ) { and it is all called by: import(custNodes); so I beleive this line is uneccessary: NSXMLDocument *custdoc = [[NSXMLDocument alloc] initWithData:[NSData dataWithContentsOfFile:@"/Users/nathan/Desktop/xml tes

Re: referencing XML Data

2008-09-16 Thread Nathan Kinsinger
On Sep 16, 2008, at 2:15 PM, Amy Heavey wrote: I've just tried this again, I just changed the start: void import( NSArray *array ) { and it is all called by: import(custNodes); I assume that means you did something like: NSArray *custNodes = [custdoc nodesForXPath:@".//customer" er

Re: referencing XML Data

2008-09-16 Thread Nathan Kinsinger
On Sep 16, 2008, at 12:52 PM, Sherm Pendley wrote: On Tue, Sep 16, 2008 at 7:39 AM, Amy Heavey <[EMAIL PROTECTED] > wrote: NSArray *customerArray = [custdoc nodesForXPath:@".//customer" error:nil]; if ([customerArray count]){ NSXMLNode *customerNode;

Re: referencing XML Data

2008-09-16 Thread Nathan Kinsinger
On Sep 16, 2008, at 1:24 PM, Amy Heavey wrote: 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 *cu

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
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"

Re: referencing XML Data

2008-09-16 Thread Sherm Pendley
On Tue, Sep 16, 2008 at 7:39 AM, Amy Heavey <[EMAIL PROTECTED]>wrote: > > NSArray *customerArray = [custdoc nodesForXPath:@".//customer" error:nil]; >if ([customerArray count]){ >NSXMLNode *customerNode; >for (customerNode in customer

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
Thanks for your help Nathan, but I'm obviously doing something really wrong, I've got the following code, NSArray *customerArray = [custdoc nodesForXPath:@".//customer" error:nil]; if ([customerArray count]){ NSXMLNode *customerNode;

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
On 14 Sep 2008, at 02:51, Nathan Kinsinger wrote: On Sep 13, 2008, at 12:50 PM, Amy Heavey wrote: I've got an NSXMLDocument *custdoc but I can't work out how to actually access the data in the document, I've looked at NSXMLElement, NSXMLParser, NSXMLNode but I just can't work out the corr

Re: referencing XML Data

2008-09-15 Thread Hal Mueller
Working from the simple NSXMLParser example from http://weblog.bignerdranch.com/?p=48 I suggest you use parser:didStartElement:... to look for and begin accumulating fields, and use parser:didEndElement:... to note completion of first_name, last_name, etc and react accordingly. In the simpl

Re: referencing XML Data

2008-09-13 Thread Nathan Kinsinger
On Sep 13, 2008, at 12:50 PM, Amy Heavey wrote: I've got an NSXMLDocument *custdoc but I can't work out how to actually access the data in the document, I've looked at NSXMLElement, NSXMLParser, NSXMLNode but I just can't work out the correct code. sample xml: − Willow Tree Crafts 99 L

Re: referencing XML Data

2008-09-13 Thread Amy Heavey
Thats where i got most of the code from, and I have seen the post on his blog, but I still can't work it out! Many Thanks Amy Heavey On 13 Sep 2008, at 20:09, Hal Mueller wrote: The "Amazone" example in the new edition of the Hillegass book is a good place to start. He's also got a ve

referencing XML Data

2008-09-13 Thread Amy Heavey
I've got an NSXMLDocument *custdoc but I can't work out how to actually access the data in the document, I've looked at NSXMLElement, NSXMLParser, NSXMLNode but I just can't work out the correct code. sample xml: − Willow Tree Crafts 99 Leggatts Way Herts WD24 5NQ GBR [EMAIL PROTECTED]