ios - How to parse SOAP response using TBXML? -
hello trying parse xml soap response using tbxml
, cannot find root element parsing. here code :
tbxml *tbxml =[tbxml tbxmlwithxmlstring:thexml]; tbxmlelement *root = tbxml.rootxmlelement; nslog(@"root: %@",[tbxml elementname:root]); tbxmlelement *rootelement = [tbxml rootxmlelement]; tbxmlelement *rootitemelem = [tbxml childelementnamed:@"item" parentelement:rootelement]; if(root) { tbxmlelement *subcategoryele = [tbxml childelementnamed:@"item" parentelement:root]; nslog(@"item: %@",[tbxml elementname:subcategoryele]); while (subcategoryele) { tbxmlelement * price = [tbxml childelementnamed:@"price" parentelement:subcategoryele]; tbxmlelement *color = [tbxml childelementnamed:@"color" parentelement:subcategoryele]; tbxmlelement * rating = [tbxml childelementnamed:@"rating" parentelement:subcategoryele]; nsstring *color = [nsstring stringwithcstring:[[tbxml color] cstringusingencoding:nsisolatin1stringencoding] encoding:nsutf8stringencoding]; nslog(@"colorstr %@",color); } }
the problem here having not entering while
loop. suggestions?
Comments
Post a Comment