내 친구가 파서 작업을 수행합니다. NSString * xmlData = [[NSString alloc] initWithData : responseData encoding : NSUTF8StringEncoding];
XMLDATA는
ABC 방송과 같아야합니다 내 친구는 문자열을 분석하고 작업
그리고 내가
xmlTextReaderPtr reader = xmlReaderForMemory([data bytes], [data length], NULL, NULL, (XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOERROR | XML_PARSE_NOWARNING));
if (reader != NULL) {
ret = xmlTextReaderRead(reader);
while (ret == 1) {
const xmlChar *name, *value;
name = xmlTextReaderConstName(reader);
if (name == NULL)
name = BAD_CAST "--";
NSString *Name = [NSString stringWithCString:(const char*)name encoding:NSUTF8StringEncoding];
value = xmlTextReaderConstValue(reader);
if (value == NULL)
value = BAD_CAST "\n";
NSString *Value = [NSString stringWithCString:(const char*)value encoding:NSUTF8StringEncoding];
NSLog("%d %d %@ %d %@",
xmlTextReaderDepth(reader),
xmlTextReaderNodeType(reader),
Name,
xmlTextReaderIsEmptyElement(reader),
Value);
ret = xmlTextReaderRead(reader);
}
xmlFreeTextReader(reader);
}
와 XML을 구문 분석 libxml2를 사용하고 결과가 너무
정확
NSString * xmlData = [[NSString alloc] initWithData : responseData 인코딩 : NSUTF8StringEncoding]; 이것이 내가하는 일이며, 작동 중입니다 – IPaPa
어떻게 파서에 전달하고 있습니까? –
파서 코드 게시 ... – DGund