Gdataxmldocument *xmls = [[gdataxmldocument alloc] initwithdata:data2 options: nil error:nil];//Get root node GDataXMLElement* rootele = [xmls rootelement]; #import "GDataXMLNode.h" //properties gdataxmlelement* newsid = [[rootele attributes] objectatindex:0];// Convert to Array nsarray *array = [rootele children]; //nslog (@ "%@ count : %d ", array,[array count]); for (int i = 0; i < [array count]; i++) { gdataxmlelement *ele = [array objectatindex:i]; // Judging by tag name if ([[Ele name] isequaltostring:@ "Content"]) { / / Direct reading of string contentstr = between labels [nsstring stringwithformat:@ "%@",[ele stringvalue]]; // read the properties inside the tag //nslog (@ "%@", [[elepic attributeforname:@ "id"] stringvalue]); } } //elementsForName: Remove the child node of the specified name //gdataxmlelement* content1 = [[content elementsforname: @ "Content"] objectatindex:0]; //children: Remove all child nodes //GDataXMLElement* pic = [[pics children] objectAtIndex:0];
Ios--xml