[Fwd: Re: [PHP5-DEV] XML in PHP5]
| From: | Christian Stocker | Date: | Thu, 30 Jan 2003 16:27:36 +0000 |
| Subject: | [Fwd: Re: [PHP5-DEV] XML in PHP5] | ||
| Groups: | php.xml.dev | ||
| Request: | Send a blank email to php-xml-dev+get-5@lists.php.net to get a copy of this message | ||
and another one
-----Forwarded Message-----
Hi
About abstracting and XML:
As I said in one of my earlier mails, I still think, we should not
abstract on the C level, because it can getting too difficult und too
non-satisfying for everyone. But we could ease the writing of an
abstraction Layer on PHP-Level, if we define a common API for DOM/SAX and
XSLT like for example JAXP for Java does.
Together with an OO interface and this approach, it should be quite simple
to write an abstraction layer on PHP level. Code could then look like the
following:
$DOMBuilder = new libxml2_dom_builder();
$document = $DOMBuilder->parse($file);
etc..
Therefore if anyone writes a xalan (or whatever) implementation,
you have just to change "new libxml2_dom_builder" to "new
xalan_dom_builder" and the rest should stay the same (as long, as both
support all used methods and no implementation specific methods are used.)
The same would go for XSLT (new libxml2_transformer()) and SAX (you get
the idea ;) ).
libxml2_dom_builder() et al. are certainly not the best chosen names for
those methods, a better naming scheme for this should definitively be
found.
I'll try to write a proto API (with ideas taken from JAXP, DOM Level 3,
etc) for this in the next weeks, unless everyone thinks this is stupid and
not worth the effort.
chregu
--
PHP 5 Development Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
christian stocker | bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid
0x5CE1DECB