need help with DOM extension !!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
trungsg
Forum Newbie
Posts: 5
Joined: Mon Feb 06, 2006 3:57 am

need help with DOM extension !!!!

Post 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 ?".
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

likely, it cannot be backported. Is there a reason you need DOM over DOMXML?
trungsg
Forum Newbie
Posts: 5
Joined: Mon Feb 06, 2006 3:57 am

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
trungsg
Forum Newbie
Posts: 5
Joined: Mon Feb 06, 2006 3:57 am

Post 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 !!!
Post Reply