PHP4->5 XML wrapper

Date May 28, 2007

I’ve written here before about the pain that is migrating PHP4 apps which use DOMXML to PHP5.  I found a wrapper system, just today, at http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/.  I know I’ve looked for this sort of thing before, and I’m not sure why I didn’t find it earlier, but it’s just made a tedious task take about 2 minutes.  Thanks guys!

While I’m sure it’s not perfect, it seems to be working well enough for what I needed it to do - basically read data from an XML file in to an array structure.  Doesn’t simplexml do that already?  Sort of, but I didn’t want to have to go revisit all the code - this wrapper recreates the missing functions giving transparent backwards compatibility.  This is the sort of this PHP5 should have shipped with from day one, along with the ability to run both 4 and 5 together as Apache modules side by side.

 Did you like this post? Buy me a hot chocolate!

4 Responses to “PHP4->5 XML wrapper”

  1. Ambush Commander said:

    While I agree that in interest of backwards compatibility, the old functions should have been retained, the new XML classes, DOM and SimpleXML, are *really* good, and for me, it’s quite painful to have to go back to PHP 4 and write XML-processing code. Make those suckers migrate! It’s for the best.

  2. mgkimsal said:

    You’ll get no argument from me that PHP5 isn’t an improvement for XML processing. It’s just that by simply shutting off old functions and making it impossible for ‘dom’ and ‘domxml’ to coexist, the PHP dev team hindered PHP5 adoption. It was/is one more thing that people to have worry about when upgrading. It’s all fine and dandy to say ‘make them upgrade’, but it’s definitely something which can take time to do right for many projects.

  3. PHPDeveloper.org said:

    Michael Kimsal’s Blog: PHP4 -> PHP5 XML Wrapper…

  4. developercast.com » Michael Kimsal’s Blog: PHP4 -> PHP5 XML Wrapper said:

    [...] his blog, Michael Kimsal points out a PHP4 to PHP5 XML wrapper he dig up over on this site: I know I’ve looked for this sort of [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">