daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <List>
  2. <CompanyallProvidersList>
  3.     <CityDetails>
  4.            <City>NewYork</City>
  5.             <Id>1</Id>
  6.     </CityDetails>
  7.     <StateDetails>
  8.             <State>Alabaster</State>
  9.       </StateDetails>
  10.     <CityDetails>
  11.              <City>Newyork</City>
  12.               <Id>1</Id>
  13.     </CityDetails>
  14.  <StateDetails>
  15.                <State>California</State>
  16.        </StateDetails>
  17.  </CompanyallProvidersList>
  18. </List>
  19.    
  20. - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
  21.  
  22.  
  23. if([elementName isEqualToString:@"CompanyallProvidersList"])
  24. {
  25. arr=[[NSMutableArray alloc] init];
  26. drr=[[NSMutableDictionary alloc] init];
  27. }
  28. srr=[[NSMutableString alloc] init];
  29. }
  30.  
  31.  
  32. -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
  33. [srr appendString:string];
  34. }
  35.  
  36.  
  37. - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString    *)namespaceURI qualifiedName:(NSString *)qName {
  38.  
  39. if([elementName isEqualToString:@"City"])
  40. {
  41.  
  42. [drr setObject:srr forKey:@"City"];
  43. [srr release],srr=nil;
  44. return;
  45. }
  46.  
  47. if([elementName isEqualToString:@"Id"])
  48. {
  49.  
  50. [drr setObject:srr forKey:@"Id"];
  51. [srr release],srr=nil;
  52. return;
  53. }
  54.  
  55. if([elementName isEqualToString:@"State"])
  56. {
  57.  
  58. [drr setObject:srr forKey:@"State"];
  59. [srr release],srr=nil;
  60. return;
  61. }
  62.  
  63.  
  64. if([elementName isEqualToString:@"CompanyallProvidersList"])
  65. {
  66. [arr addObject:drr];
  67. [drr release],drr=nil;
  68. }
  69. [srr release],srr=nil;
  70.  
  71. }
  72.    
  73. NewYork
  74. 1
  75. California
  76.    
  77. NewYork
  78.  1
  79.  Alabaster
  80.  
  81. NewYork
  82. 1
  83. California
  84.    
  85. if([elementName isEqualToString:@"StateDetails"])
  86. {
  87.   [arr addObject:drr];
  88. }
  89.    
  90. if([elementName isEqualToString:@"CompanyallProvidersList"])
  91. {
  92. [drr release];
  93. }
  94.    
  95. if([elementName isEqualToString:@"CityDetails"])
  96. {
  97.    drr=[[NSMutableDictionary alloc] init];
  98. }
  99.    
  100. - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
  101. {    
  102.   if([elementName isEqualToString:@"CompanyallProvidersList"])
  103.   {
  104.      arr=[[NSMutableArray alloc] init];
  105.      drr=[[NSMutableDictionary alloc] init];
  106.   }
  107.   if([elementName isEqualToString:@"CityDetails"])
  108.   {
  109.      drr=[[NSMutableDictionary alloc] init];
  110.   }
  111.   srr=[[NSMutableString alloc] init];
  112. }
  113.  
  114. - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString    *)namespaceURI qualifiedName:(NSString *)qName
  115. {
  116.   if([elementName isEqualToString:@"City"])
  117.   {
  118.     [drr setObject:srr forKey:@"City"];
  119.     [srr release],srr=nil;
  120.     return;
  121.   }
  122.  
  123.   if([elementName isEqualToString:@"Id"])
  124.   {
  125.  
  126.     [drr setObject:srr forKey:@"Id"];
  127.     [srr release],srr=nil;
  128.     return;
  129.   }
  130.  
  131.   if([elementName isEqualToString:@"State"])
  132.   {
  133.     [drr setObject:srr forKey:@"State"];
  134.     [srr release],srr=nil;
  135.     return;
  136.   }
  137.  
  138.    if([elementName isEqualToString:@"StateDetails"])
  139.    {
  140.      [arr addObject:drr];
  141.    }
  142.  
  143.   if([elementName isEqualToString:@"CompanyallProvidersList"])
  144.   {
  145.      [drr release],drr=nil;
  146.   }
  147.   [srr release],srr=nil;
  148. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top