Programming - - By Harry Fuecks

Generating XUL with PHP

Couple of interesting PHP / XUL projects I ran into recently, experimenting with XUL generation from PHP.

First there’s a PEAR package going through the process of approval (here): PEAR::XML_XUL. This provides a DOM-like PHP API for generating XUL. Not sure how much mileage there is in that approach through; will it add much value over simply generating the XUL using strings (or templating), as is common with HTML.

Fascinating is HV WDDX Metadata, over on phpclasses (you’ll need your own account to view the code). This seems like a more promising approach. If I’ve understood it correctly, uses WDDX (a widely XML format for serializing data) to define the “widgets” which appear in an XUL form, as well as the JavaScript used to validate them on the client side. Generation is being done with XSLT in the provided example. In other words you’d just need to modify the original WDDX document to add further fields / validation to an XUL form.

Nice to see XUL being explored by PHP developers. Any more projects out there?

Other XUL news is XULPlanet now has a PHP-manual-like comment system for some of the online references and tutorials.