NSString转成XML格式

前端之家收集整理的这篇文章主要介绍了NSString转成XML格式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

From: http://snowyshell.blog.163.com/blog/static/2209140342013519533541/

NSString*myString =@"<addresses owner='swilson'><person><lastName>Doe</lastName><firstName>John</firstName></person></addresses>";

NSData*myRequestData = [NSDatadataWithBytes: [myStringUTF8String]length:[myStringlength]];

NSXMLParser*myParser = [[NSXMLParseralloc]initWithData:myRequestData];

[myParsersetDelegate:self];

[myParsersetShouldProcessNamespaces:YES];

[myParsersetShouldReportNamespacePrefixes[myParsersetShouldResolveExternalEntitiesNO];

BOOLsuccess = [myParserparse];

release];

原文链接:https://www.f2er.com/xml/299252.html

猜你在找的XML相关文章