| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I tried your suggestions and they worked like a charm, thanks guys!
Marcel
Op 23 okt 2007, om 23:40 heeft Jim Murry het volgende geschreven:
Just pass your string to this using dataUsingEncoding
- (void)deconstructXMLResponse:(NSData *)data
{
NSError *error;
NSXMLDocument *responseXML = [[NSXMLDocument alloc] initWithData:data options:nil error:&error];
if (!responseXML)
{
NSLog(@"Error reading response: %@", error);
return;
}
NSLog(@"Response received: \n%@", responseXML);
[currentRecord setResponseRaw:[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]];
// Get a reference to the root node
NSXMLNode *rootNode = [responseXML rootElement];
if (rootNode == nil)
{
NSLog(@"error: rootNode == nil");
return;
}
else
{
NSString* tempString = [[rootNode childNamed:@"r_ONE"] stringValue];
[currentRecord setResponseONE:tempString];
}
}
On Oct 23, 2007, at 2:22 PM, Marcel Borsten wrote:I'm using NSTask to wrap an application, this application gives back XML. Can anybody sent me in the right direction in parsing the XML-response and using the elements? Do I use NSXMLParser? But this only seems to work with the contents of an URL or file. Is there a way parse XML from a string object?
Marcel_______________________________________________
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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden This email sent to email@hidden
| References: | |
| >Parsing XML from a string (From: Marcel Borsten <email@hidden>) | |
| >Re: Parsing XML from a string (From: Jim Murry <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.