Logo         Community
The Company
Your Account
Contact Us
Building XML Trees With PHP
Who needs the DOM? You've got XMLTree!

| Getting Creative |

If you've been following past issues of this column, you're probably already aware of the numerous things you can do with XML and PHP. You also probably already know the basics - that there are two ways XML can be parsed, either via the Simple API for XML (SAX) or the Document Object Model (DOM); that each method has pros and cons, and that the selection of a parsing technique depends largely on the application; and that PHP today supports both parsing methods, making it a versatile and flexible tool for XML application development.

Now, by default, all newer versions of PHP come with the XML SAX parser enabled; however, the DOM module needs to be explicitly turned on at compile time. If you're working in a development environment that is entirely under your control, this is not a problem - all you need to do is log in as root, recompile PHP and get cracking.

However, if you're working in a shared environment - for example, on your Web hosting provider's server - then it's quite likely that you won't have super-user access to the system. And since Web hosting companies are (understandably!) picky about compiling new software on their production servers, if your default PHP environment doesn't already have DOM support compiled in, it's unlikely that you're going to get it any time soon.

So, a creative solution is needed. Which is where this article comes in.

Over the next few pages, I'm going to be introducing you to a free PHP class named XMLTree, which allows you to manipulate XML document trees in a manner similar (though *not* completely identical) to that available in the standard PHP DOM extension...without requiring you to first recompile your PHP build. As you might imagine, this can come in handy in certain situations - for example, if you need a quick and dirty way to build an XML document tree from an external data source, like a MySQL database or a structured text file. So keep reading - you might find the rest of the show interesting!

How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!

more like this print this article  next page
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
In cut!...
American Chai
The Core
Find out how you can use this article on your own Web site!

Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback