GDataXMLDocument *doc2;

    doc2= [[GDataXMLDocument alloc] initWithXMLString: str

                                             options:0 error:&error];

    

    /////////////

    //XML

    GDataXMLElement *root = [doc2 rootElement];

  NSLog(@"Element Name = %@", root.name);
 
    NSLog(@"Type = %@",[[root attributeForName:@"errcode"] stringValue]);



    for (int i=0; i <[root childCount]; i++) {

        GDataXMLElement *element = [root childAtIndex:i];

        NSLog(@"Element Name = %@", element.name);

        NSLog(@"Type = %@", [[element attributeForName:@"type"] stringValue]);

        for (int j=0; j<[element childCount]; j++) {

            GDataXMLElement *subItem = [element childAtIndex:j];

            NSLog(@"Sub Name = %@", subItem.name);

            NSLog(@"Sub value = %@", subItem.stringValue);

        }

    }

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply