Sponsored Post: Working with XML is very common for PHP developers and certainly with PHP5, XML development have been boosted to an advanced object oriented level thanks to SimpleXML. So if you didn’t have the chance to work with XML and PHP5 here is your chance to look inside XML from the very beginner level to the advanced level in the No Nonsense XML Web Development With PHP 5 book, written by Thomas Myer and published by SitePoint Pty. Ltd.
The book in ten chapters and two appendixes, introduce to the world of XML and guide you step by step to create strong XML-powered web application with PHP. The book introduce also how to create a complete CMS solution with XML and PHP, and it’s interesting after you learn the basics of XML manipulation with PHP to transform it into a real world application. Overall, the book is well organized and very well written, with sample code, tips and notes, and a summary by the end of every chapter to resume what have been explained.

The first chapter is an introduction to the basics of XML, the standards, the usage, where we need it and how to use it. This is important for beginners to understand what it is all about. I like the explanation in a very simple language, not using a lots of technical words and guiding reader step by step from things which are very common to web developers such HTML, to a more advanced samples that will give you a better idea on how to create valid XML documents that you generate with PHP or write manually with Dreamweaver for example. By the end the author give a glance about the CMS project, the different features, this gives also a general idea on how to explain a web project requirements.
In second chapter you will meet the whole XML family and look more deeply inside the different standards: XML, XSLT, XPath, DTD and XML Schema, XML Namespaces and XHTML. The XHTML section is just informative without lots of details, just to know that it’s valid XML and what’s the difference from the classic HTML. Now back to XML and Namespaces precisely, the kind of sections I like because usually I noticed that PHP developers don’t much about namespaces (maybe because PHP don’t support it yet?) why and how to use it, declaration of namespaces … etc. You can find also how to use CSS, XSLT, to format and display XML data in browser, and here you go from the data aspect of XML to the visual aspect and how to render it. Of course, the chapter finishes with a look inside the CMS project and develops the News, web copy and administration section of the project.
Chapter three for Consistency: what’s DTDs and why is it important for XML. Since DTDs define how the XML document is formatted, I think it’s very important to know it very well and I mean by very well that XML developers should be able to write DTDs and manipulate it as easy as XML itself. Maybe many don’t see DTDs very useful, but I recommend you highly to dig inside it because there are lots of usage such the validation and many other amazing things that I used personally in projects such PHP VoiceXML. You can’t imagine the number of information that DTDs can give you, and how it helps in XML application development only if you use it.
After this you should know about creating XML and work with it, now you are able to display XML data in your browser things that you’ll see in details in chapter four. In this chapter there are more advanced samples mainly related to the CMS project, and you’ll start building different pages of the Content management platform using XPath, XSLT, and of course CSS to make it look cool.
Chapter five will help to finish the XML search engine started in previous chapter, using XSLT. In this chapter you’ll see the XSLT in detail and its programmatic aspects, how to sorting, counting, numbering and creating conditional processing and looping. As previous chapter, in the end you put in practice the different techniques you have learned, and here you can finish the XML search engine and create an XSLT-powered sitemap for your website.
Now back to the browser and JavaScript, because in chapter six you can learn in detail how to work with XML and JavaScript, DOM and XSLT. This is important to know because working with XML is not only about creating a valid XML document and then parse it, there is more advanced things that you can do and JavaScript is an example of how to manipulate your data in the client side.
Finally you can meet PHP and XML in chapter seven, and here you can see the different methods available in PHP to manipulate XML data using SAX, DOM, or SimpleXML for PHP5. Important to meet the different methods and know the features available in each one and how it handle XML, so you can decide in your project what to use and when, which have been explained by the end of this chapter. You will be able at this level to write the login page, the administration area, and work with articles in depth.
The next chapters provide more advanced features very well detailed and explained as previous chapters. You can learn about RSS and feeds in chapter eight, and of course you won’t forget to add feeds for the CMS project. Chapter nine put in practice web services using XML-RPC and SOAP, but the CMS here got a preference to implement the XML-RPC server and client, thing that I personally like it so much because many consider using SOAP more than XML-RPC for webservices development while you can do everything with XML-RPC, and I find it even more easy and faster to implement. Finally chapter ten is about XML and databases, but NOT XML databases. Why using a database with an XML project, for what to use it, what’s the purpose of XML if we store data in database…? And other questions answered in this chapter, in addition to building the MySQL tables, PHP scripts and a cron job to run periodically and make things work faster.
The book finish with an appendix of different PHP XML functions in addition to details about the XML CMS administration area. Overall, you can start from the beginning how to work with XML and explore the XML family to be able in the end to create a very advanced and high level PHP application. I think its worth to read and put in practice the different examples detailed in the book. You can download for free the four first chapters of No Nonsense XML Web Development With PHP 5 and sample code from SitePoint website, and currently offered a PHP Poster 17″ x 24″ for every purchase of the book, so BIG!