Using PHP 5's SimpleXML
Subject:   SimpleXML and XSLT in PHP5
Date:   2004-01-16 10:32:47
From:   anonymous2
I am getting ready to move a codebase over to XSLT for template rendering. Will SimpleXML make that process easier for PHP developers or should I look into something like the Apache Project's XSLT parser?
Full Threads Newest First

Showing messages 1 through 1 of 1.

  • Adam Trachtenberg photo SimpleXML and XSLT in PHP5
    2004-01-16 12:27:44  Adam Trachtenberg | O'Reilly Author [View]

    There are many new XML features in PHP5, including rewritten DOM, XSLT, and XPath classes. Unfortunately, I could not cover them all here.

    PHP 5's XSLT class uses libxsl, the sister library to libxml2. You pass the class DOM objects and it transforms files for you. This interface is cleaner than the PHP 4 XSLT extension, which used the Sablotron XSLT parser and didn't integrate with other PHP XML extensions.

    The current issue of PHP Magazine's Digital Edition ( contains an article by me that gives a few examples of how to use XSLT with PHP 5. (Unfortunately, this article is not available for free.)

    So, to answer your question, if you're using PHP 4 and want to do more XSLT, then PHP 5 is definitely a step up. I hope that helps. Let me know if you have other questions.