Title: Pro PHP XML and web services
Author: Robert Richards
If you are a PHP programmer and looking to expand your knowledge in XML and web services areas, the book is a good resource. The book assumes no prior knowledge about XML and web services. It assumes you are capable of writing PHP programs independently.
Download the table of contents PDF document from the publisher.
The first four chapters of the book are dedicated to XML itself. Rob starts off with a clear introduction to XML, its history, SOA and web services. Building upon the incremental familiarity with the jargon, the author proceeds to XML structure, RELAX NG, validation, XPath, Xpointer, XInclude and related topics. Absolute beginners may find it a bit overwhelming to grasp all of these technologies in the first reading. If that is indeed the case, I would recommend you to read the W3 Schools tutorials in conjunction with the book.
Chapter 5 describes the various options available in PHP to work with XML.
Chapters 6, 7, 8 and 9 are dedicated to DOM, SimpleXML, SAX and XMLReader respectively. The PHP DOM extension conforms to the DOM specification. It gives you, the developer, a lot of power to manipulate the DOM using standard APIs. If you aren't performing heavy duty manipulations of XML documents and are perfectly okay with limited capabilities of the API, SimpleXML is the way to go. We have demonstrated this in one of our previous blog posts - PHP Script To Shorten URLs Using short.ie. The SimpleXML extension is interoperable with the DOM extension. Don't miss out reading chapter 6, even though chapter 7 might suffice your immediate programming requirement. Chapter 8 examines stream based parsing of XML documents using the XML extension. Chapter 9 is dedicated to the XMLReader extension. These four chapters provide enough information to get you started in real word projects immediately. Armed with the knowledge of all the native PHP XML parsers, you should be on your way to become a pro PHP XML programmer.
One of the great powers of XML is its ability to be used as a data source to produce different types of output. You can generate XHTML, PDF, CHM and variety of other formats. Take the case of the Zend Framework official documentation. The documentation source is maintained in docbook format. From the XML source, PDF, HTML and CHM format files are automatically generated. If you want to master this art of transforming the XML documents to other formats, chapter 10, Extensible Stylesheet Language Transformations (XSLT) is a must read.
When you initially discover various ways to work with XML using PHP, it can be difficult to decide which extension to use in what context. Rob carefully measures the strengths and limitations of various parsers. Chapter 11 contains abundant practical tips to help you determine the best approach to proceed with.
Given any software technology, security is a concern we all have to deal with. Chapter 12 helps you get started with XML signatures, XML encryption and related topics. Chapter 13 talks about what PEAR offers to work with XML.
Feeds have become the de-facto standard to subscribe to syndicated content. Chapter 14 shows how to create and parse RSS 1.0, RSS 2.0 and Atom 1.0 XML feeds.
Armed with enough knowledge to manipulate XML documents in PHP, the book prepares you to to enter into the world of web services. Chapter 15 introduces WDDX. Although Web Distributed Data eXchange can be used to develop network based software, the technology isn't as popular as REST and SOAP. It is good to keep WDDX in mind when developing applications that requires to interact with sub systems over the network. Chapter 16 introduces XML-RPC. XML-RPC can be quite handy to pass information from a web application to numerous types of clients. The clients are empowered to call remote procedures on the web server. Be sure to check out our XML-RPC and PHP series.
Chapter 17 introduces you to the world of REST. The chapter provides examples to consume Yahoo! and Amazon web services using their REST APIs. Invariably, APIs of providers change frequently. Books quickly become outdated when demonstrating public API consumption. Thanks to extensive documentation of these providers, you can make the changes to the scripts yourself. The web contains enormous tutorials, how to articles, code samples and presentations on the topic. I have uploaded the slides from my talk about REST in the Bangalore user group meeting. Download or view the slides. I'm writing a series of blog posts on building RESTful applications using the Zend Framework. Stay tuned with the series.
Chapter 18 explains how to develop SOAP servers and clients using PHP. However, the author states that SOAP can be complex give the fact you have to generate WSDL documents. The good news is that the author teaches SOAP including writing WSDL documents from the ground up.
The last three chapters of the book talks about UDDI, web services using PEAR and some of the related XML technologies and PHP extensions.
The book is a fantastic resource for a PHP programmer to learn XML and web services. It deserves to be in the shelf of every PHP programmer. After reading the book you will discover that the author is truly a master in XML and PHP. Rob Richards is a contributor to PHP itself. He's been working with XML since the day it was incepted. Rob has authored the DOM, XMLReader and XMLWriter PHP extensions. He has also contributed to the GNOME llibxml2 project. Rob is also a speaker in PHP and XML related conferences.
I can say with confidence, after reading this book, you will not only increase your knowledge of PHP and XML, but also think about new ways of solving day to day problems. Since, by design, XML is not tied to any programming language or platform you can utilize this knowledge in other programming languages as well.
Preview the book on Google books.
Are you going to read the book? Have you, already? Do you know of other good resources to learn XML that a PHP programmer can use?