O'Reilly logo

iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch by Maher Ali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. XML Processing

In this chapter, you will learn how to effectively use XML in your iPhone application. The chapter follows the same theme used in others chapters and exposes the main concepts through a working iPhone application: an RSS feed reader.

The chapter is organized as follows. Section 11.1 explains the main concepts behind XML and RSS. Section 11.2 presents a detailed discussion of DOM parsing. Section 11.3 offers another, different XML parsing technique, SAX, and shows how you can write a SAX iPhone client. In Section 11.4 we look at a table-based RSS reader application. Finally, Section 11.5 provides a summary of the main steps you need to take in order to effectively harness the power of XML from within your native iPhone application.

XML and RSS

XML

Extensible Markup Language (XML) is a meta-language specification for exchanging information over the internet. As a meta-language, it can be used to define application-specific languages which are then used to instantiate XML documents that adhere to the semantics of these languages.

The power behind XML is due to: (1) its extensibility, which allows anyone to define new XML elements, and (2) it being based on text, thus opening your application data to being used on any computing system.

To create/use an XML language, you need to identify the elements used in that language. An XML element uses: (1) a begin-tag, (2) text content, and (3) an end-tag. For example, the element person can appear in an XML document as: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required