ABSTRACT

Extensible markup language (XML) is structured in a simple and common format and provides a platform-neutral, efficient way of sharing and storing data. As such, an XML document can be shared by computers with completely different components, interfaces, configurations, and operating systems. This chapter presents two techniques for working with XML. First, it explains and implements the 'SimpleXMLElement' class as a means to convert XML into an object that can be processed with normal property selectors and array iterators. The chapter then explains XPath as a means of finding information in an XML document. XML uses tags in the same way as HTML. Unlike HTML, XML does not have a fixed range of tags and attributes. XML stores data in a hierarchical structure according to meaning and without any reference to web page presentation. That is, XML provides an elegant way to separate data from format.