Page 1 of 1

need help with DOM extension !!!!

Posted: Mon Feb 06, 2006 4:06 am
by trungsg
Hi everyone,
i'm working with XML document. I work on PHP 4.3.2. From PHP5, DOMXML extension is replaced by DOM extension. Because of some reasons, i can not chage PHP version, so my question is : "is it possible to take DOM extension from PHP5 to use with PHP 4.3.2 ? and how to do it ?".

Posted: Mon Feb 06, 2006 9:47 am
by feyd
likely, it cannot be backported. Is there a reason you need DOM over DOMXML?

Posted: Tue Feb 07, 2006 9:03 am
by trungsg
Thank feyd,
just because someone else are using also this PHP server, so people do not agree to update to new version. If i do something with DOMXML, oneday, they decide to make update, all the things i done will be threw(in version 5, DOMXML has been completely replaced). And DOM is quite better than DOMXML, it follows W3 standard. i think of using another library, which is independent from PHP version. do U have any idea ?
Thanks again Feyd.

Posted: Tue Feb 07, 2006 9:18 am
by feyd
you could write an interface class that in its internals uses DOMXML, and also make a version that uses DOM. Simply detect if DOM is available (possibly through version_compare(), but more realisticly through checking what extensions are loaded) to help your code decide which version to use.

Posted: Tue Feb 07, 2006 11:02 am
by trungsg
Thanks for your answer, it's nice of u, your answer help me alot ! it's a great idea, but any way i have to works twice times (one with Dom, one with DOMXML).
I have another question "Do u know how to make a request on many XML files ?" Because i have data in a set of separated XML files !!!