iOS how to get a name of tag in XML

tranvutuan

macrumors member
Original poster
Dec 19, 2011
74
0
Given a sample.xml like below

Code:
<myXML>
   <item1>   this is my item1   </item1>
   <item2>   this is my item2   </item2>
</myXML>
Using RatupreXML parsing, how can i get a name of each tag .. I did tried

Code:
RXMLElement *tmp =   [RXMLElement elementFromXMLFile:@"sample.xml"];
NSArray      *arr  =   [tmp child:nil];
for ( id obj in arr )
    NSLog(@" obj in arr is %@ ", (NSString*)obj );
Result shown on the console is

Code:
obj in arr is this is my item1
obj in arr is this is my item2
Any idea how to achieve tagName item1 and item2 . Please advice me. Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.