Blog Posts

domxml and PHP 5

From time to time I see people trying to compile domxml (from PHP 4) for PHP 5. While it basically works and is technically possible, I highly recommend to not even try to go this route. There is a very high potential for conflicts with the new dom extension or any other libxml2 based extension (like SimpleXML, XMLReader, XSL, etc). If not today, then maybe in later releases.

But one thing is for sure: domxml isn't maintained/developed anymore and you won't get any support from me (or other PHP-XML-Developers) in getting that to work. You're completely on your own and domxml/php5 related bugs filled into the bugsystem will be bogusfied almost immediately :)

Therefore the best and only sane way to migrate from PHP 4 to PHP 5 is to port your domxml code to the much better dom code. It's a one time effort and really worth it.

BTW, I like to hear, if anyone is successfully using domxml with PHP 5 on production servers. I never tried it (and have no plans to do it), but I'm still wondering. Will not change my stand on this regarding supporting it, but nevertheless.

Tags:
Related Entries:
- Added DOMNode::getNodePath
- How to extend SimpleXML with missing functionality
- Check your XML catalogs ....
- Any missing XML features in PHP?

About the author

Comments [7]

Mike Willbanks, 07.11.2005 16:15 CEST

I actually just finished porting from the old domxml extension to the php 5 dom. It took a little time since I had a huge object but overall it was much faster.

For testing I had used some of the old domxml and switched that to simple xml. Either way it works better now :)

Daniel Burckhardt, 10.11.2005 00:11 CEST

If you don't want to port or have a solution that runs both under php4 and php5, have a look at
http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html
by Alexandre Alapetite. It worked very well for me and the author is very friendly.

notuo fernandez, 24.08.2006 22:41 CEST

Hi.

I have an application (easynav from http://www.wait-till-i.com/index.php?p=63 This app uses domxml_tree which as far as I understand is a different thing that the DOM or DOMXML.

Is there a way to have domxml_tree stand alone from domxml in php 5?

Thanks in advance,

Notuo

Jonathan, 13.09.2008 22:04 CEST

This is a joke. This is exactly why I am a .NET developer and only do PHP when the client absolutely insists on it.

Chregu, 15.09.2008 10:18 CEST

No, this was one of the better desicions, so we could concentrate on making and maintaining the new dom extension and not having to waste time on the broken-by-design domxml extension

And if you're happy with .NET and I'm happy with PHP, everyone's happy :)

I., 28.01.2009 11:17 CEST

Not everyone's happy. It's easy to say 'port your code to new dom code, it's much better'. For developers like me it's not an option. There's tons of code customized specifically for clients that stop working when they or their isp's upgrade to php5. Even if they're said not to. Who do you think they call when things go wrong? Man, I wish I was more into dotnet development at moments like this.

I'll definately try out Alex's migration tool. If it works, I'll make the company donate to his paypal.

molafish, 29.11.2010 19:32 CEST

You .net idiots think nothing breaks in .net framework when upgrading from 1.1 to 2.0? or 2.0 3.5? or 3.5 to 4.0? What a freaking joke. Php as a whole has far better longevity support.

Add a comment

Your email adress will never be published. Comment spam will be deleted!