Re: Replacing expat with libxml

From: Date: Sat, 10 May 2003 00:19:32 +0000
Subject: Re: Replacing expat with libxml
References: 1  Groups: php.xml.dev 
Request: Send a blank email to php-xml-dev+get-110@lists.php.net to get a copy of this message
Could it be worth bearing in mind a potential PEAR project to unify the various XML extensions (and even PHP based ) out there? Starting to be a pretty good selection out there; SAX: expat, libxml DOM: libxml, QDom (still maintained?) XSLT: Sablotron, libxml, Xalan (http://www.nttslab.de/php_xalan/) Would really help if any new PHP XML extensions could provide an API that makes them similar to the others so that PEAR could unify them (as with PEAR::DB) in a similar way to Java's JAXP specification. Taking XSLT for example today with Sablotron and Xalan it's; <?php // Sablotron $xslt = xslt_create(); $result = xslt_process($xslt, 'sample.xml', 'sample.xsl'); // Xalan (think this is how it works from a glance at the source code) $result = xalan_process('sample.xml', 'sample.xsl'); ?> Perhaps PEAR could provide an interface "Transform" e.g.; <?php interface Tranform { function process ($xml,$xsl) {} } class SabTransform implements Tranform { var $processor; function __construct() {
       $this->processor= xslt_create():
} function process($xml,$xsl) {
       return xslt_process($this->processor,$xml,$xsl);
} } class XalanTransform implements Tranform { function process($xml,$xsl) {
       return xalan_process($this->processor,$xml,$xsl);
} } ?> Certainly if the new libxml extension is going to provide a SAX API would be great to see this behave in a similar manner to expat so it's easy to unify with some classes. Otherwise are there any plans for XML Schema support in particular validation? I've heard libxml provides something but don't know what. Schema validation would be a big help for working with SOAP/WSDL. Anyway - many thanks for the great work your doing.

« previous php.xml.dev (#110) next »