No Nonsense XML Web Development with PHP, Thomas Myer

PHP doesn’t spring to mind when thinking about processing XML data, but PHP is a better solution than you might think. Since PHP is used to develop websites, which use HTML a standard based on the principles of XML, PHP is a sensible choice. PHP also includes powerful tools for parsing and manipulating XML data. We can use this to our advantage to convert and manipulate XML information in our PHP based web applications. XML-RPC and SOAP also use XML, so the use of a web-based language for web-services is also another obvious choice.

All of these situations are covered in extensive detail by Thomas Myer in his new book, No Nonsense XML Web Development with PHP from publisher SitePoint, a long time source for articles and information on web applications and development.

No Nonsense XML Web Development with PHP

The contents

No Nonsense XML Web Development with PHP covers a gamut of different topics, from an introduction on the basics of XML and its uses through to web services. Throughout, the straightforward and relaxed tone of the book help you to pick up the background behind what Thomas is teaching you, as well as the specifics of different aspects in the book.

We start off with a simple examination of XML and the role of DTDs in the consistency of the XML data. Thomas is right here to point out that DTDs are about consistency, rather than restriction, on the information we store in XML. He also covers the role that DTDs have in validating information, often simplifying the code required in our application to confirm the quality of the content.

Our first foray into the specifics of XML and PHP starts in Chapter 4 where the basics of the XSLT transformations are covered. This is also the start of a recurring theme in our application of a content management system (CMS). The book uses the CMS as a hook to link together all the different elements of the XML/PHP content and it is an approach which works well. This introduction is enhanced by a more detailed examination of XSLT before moving on to the manipulation of XMLwith JavaScript and the role of DHTML in web site development.

By Chapter 7 we are introduced to the full-blown techniques for parsing and manipulating XML data using PHP. We get in depth coverage on the different parsing techniques sich as SAX, DOM Thomas covers the fundamentals of parsing before covering the specifics of generating, and parsing, RSS/RDF information used in the syndication of web site data. The book then wraps up with coverage of web services, primarily XML-RPC and the role of databases in the use and storage of XML data.

Again, throughout, we get information and examples on how we can apply these different areas into our content management system. The entire CMS code is included in Appendix B of the book, with Appendix A holding information on the functions included in PHP for XML processing.

Pros

I like the conversational tone that Thomas uses - he doesn’t talk down to you and the concepts are introduced effectively through the use of a good progressive style and cross rereferences to other sections of the book. The use of a common goal project - the content management system - is also an excellent way to ensure that as you read through the contents, you pick up more of the detail and capabilities of PHP for XML.

The format of the book is good too - code sample are clearly defined (although the large font is a bit distracting) and each code extract is handily tagged with the file name and whether the fragment is entire or simply an extract. For each fragment there is usually a step by step examination of the code and a description of what is going on.

Cons

Very occasionally the theory of the topic being discussed seems to be a bit short and almost rushed. As a practical guide this isn’t a problem, but for some a better understanding of the theory would help with the adaptation of the practical contents. This shouldn’t really detract though from what is an excellent hands on guide to PHP and XML applications.

Recommendation

If you do any form of XML processing within PHP then this is the book you should keep on the shelf. Not only will it give you the back up theory you need, the practical examples will become invaluable.

MySQL Storage Engines

One of the key reasons why MySQL is so flexible is because of the support for different storage engines. Rather than supporting a single method for storing information you can choose the optimal method for your database and application. But how do you find out what is available, and how do you choose between MySQL Storage Engines. Are there storage engines that are better at some applications than others, and is there a handy guide that tells you?

Well, I hope so, because that is exactly what my new article, MySQL Storage Engines, aims to do.

Easily build a tiny Linux cluster

I've always loved the idea of putting together many smaller computers to make a 'personal grid' or cluster, partly out of sheer interest but also because I do some grid work and having a small grid of individual machines in a relatively small case would be an easy way to test things out.

I always liked the BriQ, although it was expensive. Now there's a cheaper Xscale CPU based unit from Team ASA in the form of the catchily titled NPWR SCE.

MySQL Conference in London

We don't often get conferences in London for some reason. Instead they end up in Amsterdam or Paris. The LinuxWorld Expo this week was a rare event, which is why I decided to attend.

At the end of November MySQL are running the first 1st Annual MySQL Northern Europe Customer Conference. It's only one day (but a full one, with evening dinner reception) with a lot of detail crammed in, including a good look at MySQL 5.

Now I have to decide if I can make it - it conflicts something else, but as such a rare event, it seems churlish not to go.

Novell’s Linux migration

Novell were once a major competitor to Windows as a network operating system with their Netware system. In fact, for many years, and especially before NT became widespread, Netware was the network operating system used for Windows machines.

Recently (comparatively), Novell purchased Ximian and SUSE, both Linux solutions, one for the desktop and one an operating system.

Now, Novell have decided to use SUSE and Ximian for their own internal network and you can read all about the migration process at Linux Planet.

Nessus, Open Source and community spirit

A recurring theme at LinuxWorld Expo was the idea of the community spirit of open source.

Let's explain what I mean by that. A lot of people mis-undersand the the term 'free software' and take it that it means the software does not need to be paid for. While in most cases that applies, the term free software generally means 'free to use and modify', that's why it's often used with 'open source'. Because we have access to the source we can check it out, modify it, improve it. For a more in depth discussion, read this post.

For some, the open source model appeals very much because of this ability to make changes and improve or customize the software to their own ends. From the developers perspective, opening the source also means that other people can look at the code, improve it and hopefully provide those improvements and enhancements back into the main code base.

Dell and Linux

At the Dell stand at LinuxWorld Expo I asked about Dell's opinion and approach to Linux. According to the guy on the stand, about 20% of the machines that Dell sell include Linux, and most of those are pre-installed.

That's an interesting statistic, but it is tempered somewhat by the fact that the figure is limited to servers, it doesn't cover all machines. As it happens, Dell don't sell a desktop (to my knowledge, at least) with Linux on it, pre-installed or otherwise. Workstations - i.e. more powerful desktops that cost more - yes, desktops, no.

However, they do supply PCs with FreeDOS in the box, and nothing installed on the hard drive. I haven't experienced the same problem mentioned by The Register. In fact, clicking on the link in the article I could quite happily find FreeDOS machines. Not the 510n, but a 515n. Given the speed with which machines are replaced today a minor digit change doesn't surprise me.

Randal Schwartz’s Perls of Wisdom

If you don’t associate Randal Schwartz with Perl then you obviously don’t know how much of an influence Randal has been in spreading the Perl gospel. Randal has been talking about Perl for years, writing articles and contributing to books like the ‘Camel’ (Programming Perl, from O’Reilly). He’s also contributed to the built-in documentation and has worked with the internals of Perl and built various modules and examples. In short, when it comes to Perl, there’s little that Randal either isn’t aware of, or hasn’t already written about.

Hia book, Perls of Wisdom, is a collection of the articles that he’s written over the years that look at specific problems or issues that users have asked him to solve with Perl. Mostly, these are reprints of the original article, but sometimes they have been updated. In all cases you get more than just the scrip that solves the problem, you also get the theory behind it, detailed information on the problem and issues being addressed, and some potential ways to extend it.

For more details, read the full review of the book at Free Software Magazine.

Sun and Google by Jonathan Schwartz

I'm going to save a longer post on my own feelings about the announcements yesterday for a later time, but there is a very good overview of how Jonathan Schwartz, President and COO of Sun.

Jonathan's Blog post looks at what the cooperation will mean for the two companies, why they are partnering with Google, and why, longer term, he believes the association will be a good one.

Definitely worth reading to see inside the decision, and to see it from the perspective (and straight from the keybo

Announcing Laptop Solaris

Regular readers will know I’ve been a long term fan and user of Solaris, but things in the Solaris space have changed recently. I haven’t used Solaris as a desktop operating system for about 7 years, but for a long time, despite working at an agency where Macs were the desktop operating system, I used to spend most of my time programming and managing a Sun server network using an Axil SPARC sworkstation running Solaris, and before that, Solaris 2 had been my desktop operating system more or less since leaving college while I managed a Sun based database system.

Now I’m going back to those roots and installing Solaris 10, and in the future OpenSolaris, onto my Sony Vaio Z1 and use it as my main desktop operating system. Just to make it interesting, that’s also a laptop. Hence Laptop Solaris is born.

For more information on what I’m going to be covering on the site, read the Intro post.

All the MCB Guru blogs that are fit to print