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
  • PrintPrint

Using XML data

The previous examples showed you how to load and decode URL-encoded variables that are in the format of variable/value pairs. However, when you have more complex data, using XML is a better way to structure, read, and use the data.

XML is similar to a traditional markup language such as HTML, which contains information surrounded by tags that are interpreted by a computer. HTML tells the Web browser how to display information—make this text bold, put this image on the left, and so on. XML is more generic than HTML, in that it lets you define information according to its content rather than its appearance. For example, you can identify one piece of information as a name and another piece of information as an address. XML also lets you order the data in an outline, or tree-like, structure. For example, the data that we loaded in the previous tasks (the caption text for three pictures on the Stage) were represented in URL-encoded format like so:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


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