Summary
In this chapter, we introduced two data formats that are used in web development. XML is used throughout in the industry to exchange data in a format that both humans and computers can read. We can use an XML file as a small database and several XML-based technologies exist to assist us, such as XML Schema, to firmly define the structure of an XML file, and XSLT to create a stylesheet to convert an XML file into another XML file, which might well be a web page. XML files can also be processed and created in PHP using SimpleXML.
JSON is the leaner and meaner format in vogue with web developers. It requires less bandwidth than XML, which is extremely beneficial when the amount of data increases. As JSON data can be processed like JavaScript objects, no additional processing code or engine is required when JSON is used.
Now, wouldn't it be nice if our data could be stored on the server in JSON as well, so none of these conversions from one format to another are needed? Yes, it would....