XML

GDataXML, Display all Element

August 26, 2012   ·   0 Comments

 
 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);

        }

    }
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
iOS Tutorial9

Amazon

adsbygoogle

Recent Posts

Categories

Amazon