Third-party parsing XML for XML parsing of IOS-database network

Source: Internet
Author: User

1. Import third-party plugins (Gdalaxmlnode)   2. Third-party plug-in configuration   libxml/tree.h Path  Search in the project properties--bulid settings --search Paths--headr Search Paths Add path (/USR/INCLUDE/LIBXML2)   Non-Arc  --bulid phases in the project properties --compile Sources in--gdataxmlnode.m add parameter (-FNO-OBJC-ARC)   third-party library file loading  --bulid phases in the project properties--link binary with LIBRAIES--LIBXML2 file   3. Using third-party plugins  //Set URL  Nsurl * url=[nsurl urlwithstring:@ "XML remote Path"];  //Session nsurlsession * session=[nsurlsession sharedsession]; //Tasks nsurlsessiondatatask * task=[session datataskwithurl:url completionhandler:^ () { }];   //Task start  [Task resume];  //Data Security Configuration  info.plist---OPen as--source Code  Add  <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>   Import third-party libraries  #import "GDataXMLNode.h"   Document-based parsing  //Create a document  gdataxmldocument * Doc =[[gdataxmldocument alloc] initwithdata:data options:0 Error:nil];  if (doc) {  //Get root element  gdataxmlelement *rootelement=doc.rootelement;   //Fast traversal  For (gdataxmlelement * student in Rootelement.children) {  For (gdataxmlelement * student.children) {  NSLog (@ "%@,%@", Property.name,proparey.stringvalue): }  }  }else{  }  

Third-party parsing XML for XML parsing of IOS-database network

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.