Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

15. Networking > Recipe: Converting XML into Trees

Recipe: Converting XML into Trees

The NSXMLParser class provided in the iPhone SDK scans through XML, creating callbacks as new elements are processed and finished (that is, using the typical logic of a SAX parser). The class is terrific for when you’re downloading simple data feeds and want to scrape just a bit or two of relevant information. It may not be so great when you’re doing production-type work that relies on error checking, status information, and back-and-forth handshaking.

Trees

Tree data structures offer an excellent way to represent XML data. They allow you to create search paths through the data, so you can find just the data you’re looking for. You can retrieve all “entries,” search for a success value, and so forth. Trees convert text-based XML back into a multidimensional structure.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint