Notes : domxml-php4-php5

Thank you very much! Really useful and handy!!

Graziano
2016-04-13T20:49:08+00:00@GMT+02:00 93.48.???.??? (IT)

thanks alexandre, you saved me hours of work with your code snippet.

-m
2013-06-07T23:10:17+00:00@GMT-04:00 cpe-???.rr.com (US)

Alex,
Nice work. Really appreciated!

Tim Atherton
2012-04-23T20:52:10+00:00@GMT+01:00 cpc4-???.virginmedia.com (GB)

Thanksssssssssssss for the script. It save lot of time to convert it to PHP5.

Kunal
2011-12-13T04:18:55+00:00@GMT+05:30 117.199.???.??? (IN)

Thank you so much for the script Alex! It works like a charm and have saved us a lot of work from migrating to PHP5.

May
2011-11-22T14:07:46+00:00@GMT-05:00 ???.gc.ca (CA)

Aitor: Thank you for your report. I have just released version 1.23 to address your problem, but in another more generic manner. Please tell me if it works as intended.

Alex
2011-11-19T18:58:04+00:00@GMT+01:00 1006ds4-???.fullrate.dk (DK)

Hi,
I think you have a bug in 497 line. It should be:
function domxml_xslt_stylesheet_doc($dom_document) {return new php4DomXsltStylesheet($dom_document->myDOMNode);}

Aitor
2011-11-19T14:57:21+00:00@GMT+01:00 ???.euskaltel.es (ES)

I get the below error:
Fatal error: Call to a member function dump_mem() on a non-object in

kgeorge
2011-06-17T10:15:42+00:00@GMT+05:30 ABTS-???.airtelbroadband.in (IN)

Thanks a bunch man. Saved me a total headache with a server move!!! You rock!

Steve Van Etten
2011-06-02T19:37:52+00:00@GMT-04:00 75-???.comcastbusiness.net (US)

Thanks, Alex you are God.

Alberto
2010-10-07T16:39:18+00:00@GMT+02:00 ???.ono.com (ES)

thanks a lot Alex, the scripts works very fine!

CGAREDES
2010-07-28T15:40:25+00:00@GMT-05:00 190.144.???.??? (CO)

Can you help me?
when i use domxml-php4-php5 have some error:
Fatal error: Call to a member function get_content() on a non-object in /home/webartoxy/site7/web_i4/import/importfile.php on line 85
my code:
...
if ($dom = domxml_open_mem($contents)) {
$dom = $dom->root();
print_r($dom);
if ($dom != null) {
$dS = $dom->get_elements_by_tagname(strtoupper($keyDecimalSeparator));
line 85--->> $decimalSeparator = $dS[0]->get_content();
print_r($dom) show me:
php4DOMElement Object
(
[myDOMNode] => DOMElement Object
(

Bodia
2010-07-27T22:21:23+00:00@GMT+03:00 78-???.km.ua (UA)

An amazing piece of work. Saved me hours and hours of rewriting ancient code! Thanks!

Marius
2010-05-24T13:34:20+00:00@GMT+02:00 ???.co.za (ZA)

Merci Beaucoup. Une vielle application a pu tourner en peu de temps...

stéphane
2010-02-21T14:57:57+00:00@GMT+01:00 i07v-???.club-internet.fr (FR)

Thank you very much for this. It solved my problems with creating XML. I can't generate an XML file with one method (I was using SimpleXML) that can be used in PHP 5 and PHP 4 as well. This class rocks!!!

Cristian Gómez
2010-02-16T15:52:21+00:00@GMT-05:00 static-???.net.co (CO)

Cool, the old software which I got just works now.

php++
2009-09-26T06:43:19+00:00@GMT+02:00 ???.t-dialin.net (DE)

Many thanks - fantastic post that saved me a lot of time.

Anonyme
2009-09-18T14:48:55+00:00@GMT+01:00 cpc1-???.ntl.com (GB)

Thank you very much!

Jaume
2009-09-17T14:02:29+00:00@GMT+02:00 77.210.???.??? (ES)

Merci beaucoup!
You saved my day!

Arne
2009-08-04T14:50:04+00:00@GMT+02:00 145.253.???.??? (DE)

Great work!!!
Thank you very much

Oscar
2009-07-20T15:10:23+00:00@GMT-04:00 76-???.in-addr.arpa (PR)

GREAT JOB MAN !!!! THANKS SOOO MUCH, I saved quite a lot of time thanks to your script. The "world of software" needs more people like you. Opensource rules !

Andrés
2009-06-10T00:14:14+02:00@GMT+01:00 ???.ono.com (ES)

Carlo, nast: Please see this previous comment.

Alex
2009-03-04T20:46:08+00:00@GMT+01:00 1006ds4-???.fullrate.dk (DK)

Fatal error: Cannot redeclare domxml_new_doc() in D:\xampp\htdocs\oscommerce\catalog\includes\domxml-php4-to-php5.php on line 52
Please help

carlo
2009-03-04T19:15:16+00:00@GMT+01:00 ip184-???.versatel.nl (NL)

THX, was a great help !

flex
2009-01-10T14:29:14+00:00@GMT+01:00 ???.alicedsl.de (DE)

Thank you! It saved me a lot of boring work.

Daniel Pistelli
2008-11-22T12:15:41+00:00@GMT+01:00 host-???.tiscali.it (IT)

Anonyme: Thanks for the patch. I have integrated it and will make a few tests before doing a new release.

Alex
2008-11-20T20:43:28+00:00@GMT+01:00 2506ds2-???.fullrate.dk (DK)


--- domxml-php4-to-php5.php.orig 2008-11-20 09:44:43.000000000 -0700
+++ domxml-php4-to-php5.php 2008-11-20 09:50:09.000000000 -0700
@@ -180,6 +180,7 @@
function html_dump_mem() {return $this->myDOMNode->saveHTML();}
function root() {return parent::_newDOMElement($this->myDOMNode->documentElement,$this);}
function xpath_new_context() {return new php4DOMXPath($this);}
+ function xinclude() { return $this->myDOMNode->xinclude(); }
}
class php4DOMElement extends php4DOMNode

Anonyme
2008-11-20T16:52:41+00:00@GMT-07:00 lindon-???.quest.com (US)

Merci beaucoup, vous m'avez rendu un grand service.
Lors du passsage du php4 en php5 c'etait le dernier soucis restant que je n'avais pas vu. Et grace à vous, j'ai pu corriger le probleme en 2minutes 30.
Bonne continuation Alex !

Fab.Mounin
2008-10-09T22:59:58+00:00@GMT+02:00 88.176.???.??? (FR)

I got error :
Fatal error: Cannot redeclare domxml_new_doc() in C:\xampp\htdocs\limesurvey\admin\classes\core\domxml-php4-to-php5.php on line 41
How I to solve this error?
Thanks

nast
2008-10-08T01:55:49+00:00@GMT+07:00 202.59.???.??? (ID)

Igor: Could you please send me an example for which the current code does not work, so I can test your suggestion? Thanks!

Alex
2008-10-01T19:58:34+00:00@GMT+02:00 2506ds2-???.fullrate.dk (DK)

insert_before has a problem! the right solution for me:
function insert_before($newnode,$refnode) {return self::_newDOMElement($refnode->myDOMNode->parentNode->insertBefore($this->_importNode($newnode),$refnode==null?null:$refnode->myDOMNode),$this->myOwnerDocument);}
But any in case BIG thanks for this module.

Igor
2008-10-01T13:14:58+00:00@GMT+03:00 customer-???.livas.lv (LV)

Thank you for this!

Jon
2008-09-18T15:14:17+00:00@GMT-04:00 bas4-???.bell.ca (CA)

leParkour: I am not sure about your patch. Could you please send me a use case?
And I have just released version 1.20.

Alex
2008-07-26T00:37:57+00:00@GMT+02:00 2506ds2-???.fullrate.dk (DK)

the insertBefore function returns an error. Fixed by replacing with:
function insert_before($newnode,$refnode) {return self::_newDOMElement($this->myDOMNode->parentNode->insertBefore($this->_importNode($newnode),$refnode==null?null:$refnode->myDOMNode),$this->myOwnerDocument);}

leParkour
2008-07-04T12:40:25+00:00@GMT+02:00 ???.co.za (ZA)

rocky: Please note that this wrapper is to make PHP4 scripts work under PHP5 or newer, not the other way.

Alex
2008-06-14T23:10:56+00:00@GMT+02:00 2506ds2-???.fullrate.dk (DK)

Parse error: syntax error, unexpected T_OBJECT_OPERATOR
We are using php 4.4.8 version while using rssfeed to our website we find error. There is any way to solve this. Here is the below code:
$xml=("sample.xml");
$xmlDoc = new DOMDocument();
$xmlDoc->load($xml);
$x=$xmlDoc->getElementsByTagName('item');
for ($i=0; $i<=7; $i++)
{
$item_title=$x->item($i)->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;
$item_link=$x->item($i)->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeValue;
$item_desc=$x->item($i)->getElementsByTagName('description')->item(0)->childNodes->item(0)->nodeValue;
$item_creator=$x->item($i)->getElementsByTagName('category')->item(1)->childNodes->item(0)->nodeValue;
$item_pubdt=$x->item($i)->getElementsByTagName('pubDate')->item(0)->childNodes->item(0)->nodeValue;
}
Please help us...

rocky
2008-06-06T04:29:25+00:00@GMT+05:30 ABTS-???.airtelbroadband.in (IN)

Ok, this is the same what dump_mem() method.

bro
2008-05-29T12:54:16+00:00@GMT+01:00 212.14.???.??? (PL)

Fatal error: Call to undefined method php4DOMDocument::dumpmem() ;(

bro
2008-05-29T12:48:54+00:00@GMT+01:00 212.14.???.??? (PL)

You are a GOD! Thank you SO much for making this script.

Scott S.
2008-02-17T01:26:51+00:00@GMT-08:00 adsl-???.pacbell.net (US)

Josh: I am glad you like this work. As you ask, there is a link to a PayPal donation in the licence section a bit higher on this page. Thanks!

Alex
2008-01-16T10:26:22+00:00@GMT+01:00 2506ds2-???.fullrate.dk (DK)

Alexandre, Awesome job ... you just saved me an hour worth of work. Put a tip jar up and I'll definitely donate for this superb work.

Josh
2008-01-16T05:38:41+00:00@GMT-06:00 c-???.comcast.net (US)

Help Please
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Extra content at the end of the document in Entity

Jay
2007-12-08T02:17:38+00:00@GMT-06:00 216.141.???.??? (US)

Merci beaucoup d'avoir partager ce travail !
Ca marche nickel !!!!

Rémy Sironneau
2007-11-05T18:24:31+00:00@GMT+01:00 ???.nerim.net (FR)

Oh, great!
I love you!

Kevin
2007-10-17T08:37:34+00:00@GMT+08:00 61.183.???.??? (CN)

Thank you very-very much, Alexandre! It's great work!

Alexey (Russia)
2007-10-12T06:03:18+00:00@GMT+09:00 ???.bwc.ru (RU)

Je ne peu pas ouvrir mon composant Exposer 4 car je recois ce message:
Your system dose not meet the SYSTEM REQUIREMENTS to run the Expose config section.
DOMXML extension unavailable
Que faire?
Merci

lOPEZ
2007-09-25T10:00:51+00:00@GMT+02:00 h-???.colt.net (DE)

Nice module and I hope it works well. I was thinking to write one myself, but now I can reuse yours and save some time to spend with my wife :)

Stanley Stanev
2007-08-23T17:12:06+00:00@GMT-05:00 ast4-???.cisco.com (US)

nice module, I was thinking to write one myself, but now reusing yours will save me some time...

Stanley Stanev
2007-08-23T17:06:31+00:00@GMT-05:00 ast4-???.cisco.com (US)

Thank you VERY much... this has been the most painful part of PHP4 -> PHP5 migration and you've smoothed it over greatly. Much appreciated!!

Brandon
2007-08-10T20:07:23+00:00@GMT-07:00 ???.ebay.com (US)

Thank you so much this really helped me out in a tight spot!

Rachel Primrose, New Zealand
2007-07-25T20:38:55+00:00@GMT+12:00 123.100.???.??? (NZ)

joeroberts: Please use e-mail to report problems. If possible, include a minimal standalone script that works with PHP4/domxml without any warning, to illustrate the problem.

Alex
2007-05-06T23:02:47+00:00@GMT+02:00 2506ds2-???.fullrate.dk (DK)

thanks for the code It helped me with 85% of my program but i get one error stell
Fatal error: Uncaught exception 'DOMException' with message 'Invalid Character Error' in /home/content/j/o/e/joerobe/html/include/extensions/domxml-php4-to-php5.php:87 Stack trace: #0 /home/content/j/o/e/joerobe/html/include/extensions/domxml-php4-to-php5.php(87): DOMDocument->createElement('68c3b705c3b72ee...') #1 /home/content/j/o/e/joerobe/html/include/bencoder/bdecoder-domxml.php(151): php4DOMDocument->create_element('68c3b705c3b72ee...') #2 /home/content/j/o/e/joerobe/html/include/bencoder/bdecoder-domxml.php(72): BDec_dictionary(Object(php4DOMElement), 'd4:name23:(pc)C...') #3 /home/content/j/o/e/joerobe/html/include/bencoder/bdecoder-domxml.php(159): BDec(Object(php4DOMElement), 'd4:name23:(pc)C...') #4 /home/content/j/o/e/joerobe/html/include/bencoder/bdecoder-domxml.php(72): BDec_dictionary(Object(php4DOMElement), 'd4:name23:(pc)C...') #5 /home/content/j/o/e/joerobe/html/include/bencoder/bdecoder-domxm

joeroberts
2007-05-05T22:16:56+00:00@GMT-05:00 adsl-???.sbcglobal.net (US)

c'est celia voici mon adresse mickael.guicheteau chez orange.fr

celia
2007-04-12T15:31:05+00:00@GMT+02:00 ANantes-???.wanadoo.fr (FR)

je cherche une extension pour com peut ut m'aider? merci

celia
2007-04-12T15:29:30+00:00@GMT+02:00 ANantes-???.wanadoo.fr (FR)

Alex,
Thanks for the good work. You helped me a lot!

Chris Sommers, CA, USA
2007-04-10T05:05:42+00:00@GMT-07:00 ???.direcpc.com (US)

Alexandre- Excellent contribution! Truly useful for anyone dealing with the big change in XML handling between PHP4 and PHP5. However...
Re: Post by Nicholas 2006-12-27T16:35:11+00:00, I too need the inverse... code in PHP5 dom but need converter/wrapper to execute with PHP4 domxml. Anyone know of such a thing?

SAR
2007-04-03T11:37:14+00:00 pool-???.verizon.net (US)

Thanks a lot. Very useful.

Javier Callico
2007-03-23T19:07:38+00:00@GMT-04:00 ???.maritz.com (US)

MAN! You saved ma whole day of work! Thanx dude! Just want you to know that your hard work is appreciated! Thanx once more!

DakiPro
2007-03-06T11:34:50+00:00@GMT+01:00 82.208.???.??? (YU)

Walker: Please use e-mail to report problems. Include a minimal standalone script that works with PHP4/domxml without any warning, to illustrate the problem.

Alex
2007-02-13T21:43:19+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

well, i found this error, and cant execute my Src :(
Fatal error: Call to undefined method php4DOMText::get_attribute() in C:\apache2\htdocs\modelo\versao20\adm\bib\xml.php on line 99
line 95: $n1 = $root->children()
line 98: $n2 = $n1->children()
line 99: $coded = $n2->get_attribute('encoded');
any suggest?

Walker
2007-02-13T13:21:29+00:00@GMT-03:00 201-???.net.br (BR)

Slux: Please use e-mail to report problems. Include a minimal standalone script that works with PHP4/domxml without any warning, to illustrate the problem.

Alex
2007-02-06T19:12:51+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

mm.. thanks! but, now this wrapper not work! :\ some debug:
Notice: Undefined property: php4DOMDocument::$myOwnerDocument [/home/slux/sviluppo/php/slux_site/xml_libs/domxml-php4-to-php5.php:345] in /home/slux/sviluppo/php/slux_site/xml_libs/domxml-php4-to-php5.php on line 188
Fatal error: Uncaught exception 'DOMException' with message 'DOMXPath::__construct() expects parameter 1 to be DOMDocument, null given' in /home/slux/sviluppo/php/slux_site/xml_libs/domxml-php4-to-php5.php:346 Stack trace: #0 /home/slux/sviluppo/php/slux_site/xml_libs/domxml-php4-to-php5.php(346): DOMXPath->__construct(NULL) #1 /home/slux/sviluppo/php/slux_site/xml_libs/domxml-php4-to-php5.php(109): php4DOMXPath->php4DOMXPath(Object(php4DOMDocument)) #2 /home/slux/sviluppo/php/slux_site/xml_libs/xml_pages_lib.php(580): php4DOMDocument->xpath_new_context() #3 /home/slux/sviluppo/php/slux_site/include/admin_head.inc.php(64): check_blog() #4 /home/slux/sviluppo/php/slux_site/admin_index.php(10): include('/home/slux/svil...') #5 {

slux
2007-02-06T14:46:30+00:00@GMT+01:00 host60-???.telecomitalia.it (IT)

In response to the previous comment about unlink_node(), version 1.15 has been released.

Alex
2007-02-05T22:53:25+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

very very nice! :D but i need of a feature... php4DOMElement::unlink_node() is not present into your converter :\ I see only remove* functions...! byez!

slux
2007-02-05T10:50:52+00:00@GMT+01:00 host60-???.telecomitalia.it (IT)

Sathish kumar I: Please use e-mail to report problems. Include a minimal script that works with PHP4/domxml.

Alex
2007-01-31T15:39:04+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

domxml-php4-to-php5.php is awesome.But i get this error.
Fatal error: Call to a member function set_name() on a non-object in

Sathish kumar I
2007-01-31T14:32:39+00:00@GMT+05:30 ???.net.in (IN)

Thanxs a lot - worked fine for me - just out of the box ;-) Greetz from Hamburg

Yezz
2007-01-20T02:45:28+00:00@GMT+01:00 ???.hansenet.de (DE)

I need to do the inverse, code using the new DOM but keep it compatible with PHP4 servers

Nicolas
2006-12-27T16:35:11+00:00 200-???.net.ar (AR)

Hi Alexandre,
just encountered problems concerning missing dom_xml-functions after upgrading from php4 to php5.
Searched the web, found your script and that solved the issues.
Great work thanx a lot
best regards
steve

Anonyme
2006-12-10T11:28:56+00:00 ???.pppool.de (DE)

Hi Jan, Replace $x == "" with empty($x) and that will fix the issue.

E-junkie
2006-11-29T06:32:18+00:00@GMT-07:00 ip68-???.cox.net (US)

This is awesome! Saved me tons of time that would otherwise have to be spent changing code. Thanks!

Leon
2006-11-28T15:36:16+00:00@GMT+08:00 202-???.com.sg (SG)

Wolfgang: Please use e-mails for reporting problems. I have made an update 1.12 adding deprecated functions that will help. Here is an update for the wms_functions.php you use http://paste.uni.cc/10785

Alex
2006-10-11T23:08:36+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

Nice job, Alexandre!
But I'm having a little problem which results in the following error being thrown:
PHP Fatal error: Uncaught exception 'DOMException' with message 'DOMXPath::__construct() expects parameter 1 to be DOMDocument, object given' in domxml-php4-to-php5.php:369
Stack trace:
#0 domxml-php4-to-php5.php(369): DOMXPath->__construct(Object(DOMElement))
#1 domxml-php4-to-php5.php(52): php4DOMXPath->php4DOMXPath(Object(php4DOMElement))
#2 wms_functions.php(178): xpath_new_context(Object(php4DOMElement))
#3 wms_layerframe.php(140): wms_layer2html(Object(php4DOMElement), 0)
#4 {main}
thrown in domxml-php4-to-php5.php on line 369
Any idea what's going wrong?

Wolfgang
2006-10-11T16:23:32+00:00@GMT+02:00 ???.t-dialin.net (DE)

GREAT SOLUTION! THANK YOU VERY MUCH! :)

All the way from Venezuela
2006-09-29T21:10:10+00:00@GMT-04:00 ???.cantv.net (VE)

merci beaucoup pour cette initiative,
c'est vrai que lorsque l'on a plusioeurs serveurs avec des config différentes c'est la genre de script qui rend la vie bcp plus simple!!!

fredMurdoc
2006-08-23T17:26:35+00:00@GMT+02:00 ip-???.numericable.fr (FR)

Dan: Try to make in pure PHP4/domxml a minimal test case that works under PHP4 and uses all the functions you need. PHP4/domxml has some basic support of namespaces (See http://www.php.net/manual/ref.domxml.php). Send your test case to me by e-mail and I will try to update this wrapper so that your script can also work under PHP5/dom.

Alex
2006-08-08T22:14:22+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

Hi,
I love the wrapper class, truely I can't find any comparison on the net! Which leads me to a slight problem...
Your wrapper does not support the namespace functions, as far as I can tell. I am creating some xml within a PHP class that must be compatible with php4 and php5, so your wrapper is v. useful, however, the xml output is destined for a Microsoft system, and I need to add namespaces to nodes ect.
Have you considered this issue at all? I am not as expert in php as I am in .net and .com so extending your class is a big job for me, I wouldn't even know what functions I'd need to toy with...

Dan
2006-08-08T14:55:39+00:00@GMT+01:00 80.168.???.??? (GB)

nevermind, i figured the whole thing out, sorry for all the bother. i still had the old domxml extension uncommented.

Josh
2006-07-24T04:28:49+00:00@GMT-05:00 user-???.mindspring.com (US)

OK, so I got the previous question figured out but how do i fix...
Fatal error: Cannot redeclare domxml_new_doc() in C:\PHP5\Pear\domxml-php4-to-php5.php on line 34

Josh
2006-07-24T03:48:05+00:00@GMT-05:00 user-???.mindspring.com (US)

What does this mean?
Fatal error: require_once() [function.require]: Failed opening required 'domxml-php4-to-php5.inc.php' (include_path='.;C:\php5\pear') in C:\Documents and Settings\Josh Betz\My Documents\Web\phpweather\loadweather.inc.php on line 4
Line 4 is:
require_once('domxml-php4-to-php5.php');

Josh
2006-07-24T00:32:17+00:00@GMT-05:00 user-???.mindspring.com (US)

Jan and others: Please send me an e-mail with source code when you are facing some problems.

Alex
2006-06-30T15:43:30+00:00@GMT+02:00 ???.risoe.dk (DK)

Hi Alex,
Nice work! Thank you :-)
I am trying to use your script with the google checkout API. They don't have a version released for PHP5 yet. Since my servers are running on PHP5, I thought of using your script.
When I try to run the script, I get the following error:
Fatal error in line 74 of fileC:\WEB\google-checkout\CheckoutAPIFunctions.php
- Object of class php4DOMDocument could not be converted to int
Let me know if you have any ideas or if I'm doing something wrong. I have included the code to require your script as you have mentioned. Thanks.

Jan
2006-06-30T11:47:59+00:00@GMT+06:00 ???.sltnet.lk (LK)

This is all very well, but what about those of us who wrote in php5's dom and want it back to php4's domxml? It looks as though I'll have to rewrite in domxml language...

Chris
2006-06-11T10:48:18+00:00@GMT+10:00 c211-???.com.au (AU)

Thank you very much.
I used the dom_XML extension too in a KnowledgeBase application.
Please note: I had to rename all add_child() functions in my old php4 code to append_child().

Anonyme
2006-06-07T10:06:54+00:00@GMT+02:00 ???.xs4all.nl (NL)

nice script.
it saved lot of my time.
and very easy to implement.

anilande
2006-05-19T09:29:40+00:00@GMT+05:30 dsl-???.touchtelindia.net (IN)

Man, you saved me a lot of work. My client website is entirely based on these PHP4 functions, it would be a pain in the ass rewrite the entire code. Nice work, thank you.

Eric
2006-05-18T20:45:12+00:00@GMT-03:00 200.207.???.??? (BR)

Aucun problème à signaler.
Réponse à Rick : merci de lire l'article, les commentaires, et de ne pas poster deux fois les mêmes questions à la suite. Contactez moi par courriel en cas de problème. Encore une fois, cette librairie est faite pour PHP5 ! Autant que je sache, votre EasyPHP/1.7 tourne par défaut avec PHP4. Sous PHP4, activez simplement l'extension domxml.

Alex
2006-05-11T09:55:21+00:00@GMT+02:00 ???.risoe.dk (DK)

J'ai des problèmes avec le code fourni et j'obtiens ces erreurs là :
?xml version="1.0" encoding="UTF-8"?><test>parseXML</test><br />
<b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or &apos;}&apos; in <b>c:\program files\easyphp1-7\www\filecassette\domxml-php4-to-php5.php</b> on line <b>236</b><br />
Merci à l'avance

Rick
2006-05-10T14:54:06+00:00@GMT-04:00 ???.globetrotter.net (CA)

Pas de problème à signaler. Vérifiez que votre version de PHP est bien la 5.x.x. Contactez moi par courriel avec un exemple minimal illustrant votre souci.

Alex
2006-05-09T20:17:55+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

<b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or &apos;}&apos; in <b>c:\program files\easyphp1-7\www\filecassette\domxml-php4-to-php5.php</b> on line <b>236</b><br />
<br />
<b>Fatal error</b>: Cannot instantiate non-existent class: php4domdocument in <b>c:\program files\easyphp1-7\www\filecassette\domxml-php4-to-php5.php</b> on line <b>38</b><br />
J'obtiens ces erreurs j'intègre le code au mien à cette ligne :
if(!$dom = domxml_open_mem($xmlstring))
je fais pourtant bel et bien le "require".
Merci à l'avance

Sean
2006-05-09T19:33:21+00:00@GMT-04:00 ???.globetrotter.net (CA)

En réponse au commentaire précédant, la version 1.9 a été publiée.

Alex
2006-04-24T17:38:44+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

Bonjour, treeeeeees pratique! bravo!
mais il manque la methode set_name() pour changer le nom d'un noeud!???

dada
2006-04-20T10:15:20+00:00@GMT+02:00 80.118.???.??? (FR)

In response to the previous comments about html_doc(), version 1.8 has been released.

Alex
2006-03-17T21:45:31+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

Thanks, works very well.

adriaan
2006-03-15T14:56:54+00:00@GMT+01:00 rt20bb246-???.routit.net (NL)

Peter: You can have a look to [http://blog.bitflux.ch/archive/2004/08/13/parsing_non_well_formed_xml_documents_in_php.html]. Please write me an e-mail for further discussion. Reference [http://zend.net/phpfunc/function.html_doc.php].
Edit: I have prepared a beta version implementing html_doc() thanks to the Tidy extension. All the best,

Alex
2006-03-02T20:47:01+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

Great application, and I think it'll do exactly what I need. One problem - I am trying to use some PHP4 code that uses an old/undocumented(??) domxml function html_doc() - any ideas? Should domxml_open_mem() work as a replacement? - can't make it!
Thanks for any ideas

Peter
2006-02-26T19:14:22+00:00@GMT-00:00 82-???.co.uk (GB)

Thank You Alex, now it's OK :-)

Tomas
2006-02-13T15:59:30+00:00@GMT+01:00 226-???.net.pl (PL)

Tomas: if you sometimes have domxml activated under PHP5, try the following code:
if (version_compare(PHP_VERSION,'5','>=')&&(!extension_loaded('domxml')))
require_once('domxml-php4-to-php5.php');
Cordially,

Alex
2006-02-12T22:39:19+00:00@GMT+01:00 83.93.???.??? (DK)

"Fatal error: Cannot redeclare domxml_new_doc()" - What's going on? (I using PHP Version 5.0.5)

Tomas
2006-02-12T16:41:48+00:00@GMT+01:00 226-???.net.pl (PL)

Wery nice and useful script, thanks!

Wolf
2005-12-26T14:31:34+00:00@GMT+02:00 ???.colocall.com (UA)

In response to the previous comment, version 1.7.2 has been released. (See the 2 previous messages)

Alex
2005-09-07T23:05:49+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

Hi Jefim,
Thank you for your comment. Unfortunately, the end of your message has been cut. You can perhaps post the rest of it again, or send me an e-mail. I will be away for a week.

Alex
2005-09-07T22:03:12+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

I have used the package and found it very useful (version 1.7.1).
The few thing i had to fix was
1. To modify the function
function is_blank_node()
{
$myDOMNodeList=$this->myDOMNode->childNodes;
$i=0;
if (isset($myDOMNodeList))
while ($node=$myDOMNodeList->item($i))
{
if (($node->nodeType==XML_ELEMENT_NODE)||
(($node->nodeType==XML_TEXT_NODE)&&!ereg('^([[:cntrl:]]|[[:space:]])*$',$node->nodeValue)))
return false;
$i++;
}
return !$this->myDOMNode->hasAttributes();

Jefim
2005-09-07T13:17:02+00:00@GMT+03:00 62.90.???.??? (IL)

Thank you Gandalf. I have used your patch, with some modifications, in version 1.7.1.

Alex
2005-08-25T13:41:40+00:00@GMT+02:00 ???.risoe.dk (DK)

http://rafb.net/paste/results/ITPBEM25.html - a small patch that was needed by my sites to run on php5.

gandalf
2005-08-25T10:26:17+00:00@GMT+02:00 host-???.crowley.pl (PL)

In response to the previous comments, version 1.7 has been released.

Alex
2005-08-09T20:11:25+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

1.
line 94 in domxml-php4-to-php5.php
have to be to restore old state
if ($encoding0) $this->myDOMNode->encoding=$encoding0;
but today (2005.08.01) contains
if ($encoding) $this->myDOMNode->encoding=$encoding0;
Please fix it.
2. Is there are way to implement
function xslt_set_base($xh, $basedir) in xslt-php4-to-php5.php
I'm trying to use WeEn CMS Thanx for your work

Vladimir Lukianov
2005-08-01T16:10:28+00:00@GMT+04:00 ???.integrum.ru (RU)

Thank you Cryo, for pointing this issue. It is now corrected in version 1.5.10.

Alex
2005-05-19T23:48:29+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

$encoding = 'CP1251';
Don't work $domdocument->dump_mem(FALSE, $encoding);
because second parameter in php4DOMDocument->dump_mem just ignored.
The desicion is php4DOMDocument->myDOMNode->encoding=$encoding

cryo
2005-05-19T09:33:13+00:00@GMT+06:00 195.12.???.??? (RU)

Thank you for the comment. Sorry for this mistake. It is corrected in version 1.5.9.

Alex
2005-04-18T21:07:25+00:00@GMT+02:00 x1-???.webspeed.dk (DK)

append_child() does not work with a newly created document with the latest version.
I went back to a version on your site 10th April and it works fine
$doc = domxml_new_doc(1.0);
$root = $doc->create_element("test");
$doc->append_child($root);
throws an error.

Nick J
2005-04-18T08:53:32+00:00@GMT-00:00 ???.press.net (GB)

Merci pour les messages. Il serait gentil de tester la nouvelle version 1.5.4 et me retourner vos commentaires (par courriel si c'est long).

Alex
2004-12-10T00:54:25+00:00@GMT+01:00 x1-???.webspeed.dk (DK)

Beau travail, malheureusement, il me manque la méthode
DomNode->prefix :'o(
Je suis sur que c'est tout simple, mais j'y arrive pas !
Erreur :
Fatal error: Call to undefined method php4DOMElement::prefix()
Merci pour votre support !

DLP
2004-12-09T17:01:09+00:00@GMT+01:00 84.97.???.??? (FR)

Thank you, you saved me from a lot of work! but the method "new_child" is missing, maybe it's already outdated...

patrick
2004-10-27T11:43:48+00:00@GMT+02:00 ???.t-dialin.net (DE)

Have emailed you regarding the testing of your PHP4 domxml to PHP5 dom(+XSL) script.

Scrumpy
2004-09-20T19:45:49+00:00@GMT+08:00 ???.net.hk (HK)

Scrumpy, that's not really easy from a technical point of view and IMHO would be a waste of time...
It's not that hard to port your script to PHP5 anyway..

chregu
2004-09-07T14:11:14+00:00@GMT+02:00 bx-???.bitflux.ch (CH)

Pour tester le passage de domxml à dom :
http://www.wampserver.com
Ca permet d'avoir un serveur apache, MySQL, PHP sous windows et de basculer entre PHP4 et PHP5. Excellent pour tester la retro compatibilité de ses scripts...

Roms
2004-07-26T13:08:00+00:00@GMT+02:00 AAubervilliers-???.wanadoo.fr (FR)

I agree that this is one approach to the problem, although I'm asking the PHP developers to add support for DOMXML to PHP5. They can remove DOMXML support when PHP5 is more mature, say at version 5.2.
I use both the XML & XSLT features of DOMXML as I had decided ages ago to use XSLT as the templating system for my website :(

Scrumpy
2004-07-22T19:35:47+00:00@GMT+08:00 ???.net.hk (HK)
https://alexandre.alapetite.fr