00001 // 00002 // XMLToObjectParser.h 00003 // 00004 // Created by Chris Patterson on 9/1/08. 00005 // Copyright 2008 Chris Patterson. All rights reserved. 00006 // 00007 // This source code was adapted from the example code listed at URL: 00008 // http://blog.atrexis.com/index.cfm/2008/7/28/iPhone--Parse-XML-to-custom-objects 00009 // That page lists no copyright information for the available source code. 00010 // 00011 00012 #import <UIKit/UIKit.h> 00013 00014 @interface XMLToObjectParser : NSObject 00015 { 00016 NSString* nodeName; 00017 NSString* className; 00018 NSMutableArray* items; 00019 NSObject* item; 00020 NSString* currentNodeName; 00021 NSMutableString* currentNodeContent; 00022 00023 NSMutableDictionary* dropioErrorUserInfo; 00024 NSError* dropioError; 00025 } 00026 00027 // Accessors 00028 00029 @property (nonatomic, retain) NSError* dropioError; 00030 00031 - (NSArray *)items; 00032 00033 // Parsing 00034 00035 - (id)parseXMLAtURL:(NSURL *)url 00036 fromNodeName:(NSString *)aNodeName 00037 toObject:(NSString *)aClassName 00038 parseError:(NSError **)error; 00039 00040 - (id)parseXMLData:(NSData *)data 00041 fromNodeName:(NSString *)aNodeName 00042 toObject:(NSString *)aClassName 00043 parseError:(NSError **)error; 00044 00045 @end
1.5.8