Book Review: Pro PHP XML and Web Services

November 30, 2006

Uncategorized

p. !Pro Pro PHP XML and Web Services. After placing your order and patiently waiting till the UPS guy arrives, the first thing you’ll notice is that this is a BIG book. It weighs in at almost 1,000 pages. Add to that the fact that it’s a hard-back book and you’ve got a book that will double as a weapon. Crack the front cover though and you’ll soon discover that your new phone-book sized shield contains a lot of useful information. Let’s dive into it a bit, shall we?

p. DevZone regulars (you know who you are) will recognize the title of this book from our earlier coverage. My buddies over at “apress”:http://www.apress.com/ sent me a sample chapter to share with you. If you missed it, “click here”:http://devzone.zend.com/article/865 to go review it.

p. As with any book of this size, Rob started things off with the obligatory history of of the topic, in this case, XML. Sometimes these “look back” chapters are interesting but come on, this is XML. Luckily, the history part of the book is very small (2 pages?) and then mercifully moves on. The rest of the first chapter contains all the topics you would expect to find in an “Introduction to XML” chapter. It’s well thought out, well written and I’m sure will be read by those seeking a cure for insomnia. The good stuff comes later on.

p. I’m not going to try and give a detailed description of each chapter. If I did, the review would be half as long as the book. What I want to do is point out a few of the highlights in the book that you will find informative. Hopefully I will give you enough information to make a decision on whether it is worth the $49.95 price tag.

p. If you are new to XML or just curious about the details, the first four chapters are going to be a goldmine for you. Rob does a great job of covering what I consider to be some very dry ground. (Let’s face it, on the surface, XML just isn’t that sexy) Rob gives a good primer on XML structure, he explain validation, and goes in-depth on XPath. All of these topics are important and at one point or another you’ll want to know about them. It’s nice to know that someone has already done the research for us and all we have to do is wade through 20-30 pages per chapter to get what we need to know.

p. If you are an XML-Xpert or just too hyper to make it through Rob laying the groundwork then skip ahead to Chapter 5. This is where things get interesting. It’s in Chapter 5 that our favorite TLA (PHP) makes it’s first appearance in the book. It is in Chapter 5 that Rob introduces the libxml2 extension in PHP 5. [Side Note: This is as goo a place as any to stop and say this. If you are programming in PHP 4 and have no intention of moving to PHP in your lifetime, don't buy this book. It will just make you long for all that you don't have and make your remaining years on earth miserable.] Since the XML extension uses streams for I/O, Rob gives a quickie overview of PHP Streams now available in PHP 5.

p. From there on out the book is sprinkled with PHP source code. Rob gives clear background information on the topics he covers as well as code snippets to illustrate his point. Chapter 7 has to be my personal favorite since Rob covers SimpleXML. While SimpleXML, as it’s name implies, is simple to get started with, it’s still a powerful tool. Rob spends 40 or so pages showing it’s ins and outs. Along the way he shows how with a few lines of code you can create or consume XML with SimpleXML.

p. SimpleXML isn’t the only XML extension Rob covers in depth, it’s just only one I’m going to mention. Suffice to say that you can flip through the PHP manual, find any mention of XML and you’ll most likely find it explained in depth in this book. This includes one of my least favorite XML technologies (and honestly, that’s a long list) XSLT. Chapter 10 is dedicated to this useful but sometimes confusing technology. If, like me, you’ve struggled with implementing XSLT, this chapter may be worth the price of the book for you.

p. Starting somewhere in Chapter 14:Content Syndication: RSS and ATOM, we start transitioning into the Web Services part of the tour. Here we start talking all the XML knowledge Rob has been feeding us with a fire hose and start using it in a most Web 2.0 way. If you’ve ever wanted to know about the “innards” of an RSS feed you’ll love Chapter 14. Details, details, details just when you think there can’t be any more to know about RSS or ATOM, BAMM! he hits you with even more.

p. Seriously, my exposure to RSS and ATOM up to this point had been setting up an account on feedburner.com. Reading this chapter opened my eyes to the depth that these too structures have. The first 10-20 pages of the chapter are strictly dedicated to the elements of these feeds in their various versions. Near the end of the chapter though Rob throws us some code to play with and try to use our newfound knowledge. He shows the basics of both serving and consuming these feeds.

p. The next few chapters cover Web APIs in detail. XML-RPC, REST, WDDX and of course, SOAP. Rob gives you the basics of each along with concrete examples of how to use them.

p. !>http://static.flickr.com/109/286002791_cbf8391094_m.jpg! The book winds down form there. That’s not to say that the remaining chapters don’t contain useful information but after the mammoth SOAP chapter, everything else seems to just pale in comparison. So I’ll wind things up too.

p. Here’s my obligatory downside to this book. This book is almost too much. I hope Rob and those wacky press-jockeys over at “apress”:http://www.apress.com/ follow this book up with a series of smaller books breaking the topics into bite-sized chunks. As a tutorial book, it’s just too much. There is too much theory to make it a practical tutorial. However as a reference book it borders on too much as well. You have to wade through a lot of detail to get at that nugget of truth you are looking for; much like XML itself! :)

p. I’m sure there are programmers that can go their entire career without touching XML. However, if you are playing in the Web Services arena, it’s a fact of life. This book is a complete guide to that world. I’ll caution you though, take it in small doses, prolonged reading of this book has been known to cause “eureka” moments in even the most junior of programmers. Translated that means that if you have to work with XML, this is a great book to have handy. You may only reference it once every month or so but when it saves your bacon or makes you look like a hero to your boss, the $49.95 will have been money well spent.

p. =C=

,

About Cal Evans

Many moons ago, at the tender age of 14, Cal touched his first computer. (We're using the term "computer" loosely here, it was a TRS-80 Model 1) Since then his life has never been the same. He graduated from TRS-80s to Commodores and eventually to IBM PC's. For the past 10 years Cal has worked with PHP and MySQL on Linux OSX, and when necessary, Windows. He has built on a variety of projects ranging in size from simple web pages to multi-million dollar web applications. When not banging his head on his monitor, attempting a blood sacrifice to get a particular piece of code working, he enjoys building and managing development teams using his widely imitated but never patented management style of "management by wandering around". Cal is currently based in Nashville, TN and is gainfully unemployed as the Chief Marketing Officer of Blue Parabola, LLC. Cal is happily married to wife 1.28, the lovely and talented Kathy. Together they have 2 kids who were both bright enough not to pursue a career in IT. Cal blogs at http://blog.calevans.com and is the founder and host of Day Camp 4 Developers

View all posts by Cal Evans

5 Responses to “Book Review: Pro PHP XML and Web Services”

  1. dblwizard Says:

    Howdy,

    Is this book really that good? The used price on Amazon is over $300. Why is it out of print now? It sounds like its a good book but I’m just wondering why is not in print anymore.

    Thanks

    David

  2. sudheerboss Says:

    Definitely worth the money. Rob is a true master in XML and PHP.

    I write a review of the book, too – http://tr.im/E9hy

  3. poldii Says:

    I waited some time to see, if this book will be available in German. Two month ago I didn’t want to wait anymore and bought in English. Its definitely worth the money and can be recommanded to everyone how is working with webservices like Amazon or Google or creating web2.0 mashups.

  4. srobert Says:

    Great reviews, it is excellent,
    after read this, I open the amazon and search this book right now, Thanks for this post.

  5. _____anonymous_____ Says:

    $35.99 at Amazon :)