Page 1 of 1

PHP5 DOM/XML trouble!!

Posted: Mon Jul 07, 2003 5:11 am
by wolfie2x
can someone pls help on PHP5 DOM/XML functions?!

* how to dump a html dom tree after creating one?
( dump_mem() doesn't work in PHP5 ?! )

thx

Posted: Mon Jul 07, 2003 6:09 am
by cactus
You must understand that PHP5 is at beta 1 right now so any issues you are experiencing could be listed on :

http://bugs.php.net/

Have you checked the bugs for PHP5 ?

To help us help you a little more, could you provide a little more detail on your error/issue, maybe post a snippet of code and the error message.

Regards,

Posted: Mon Jul 07, 2003 6:29 am
by wolfie2x
actually it's not a bug in PHP5.. the total DOM/XML usage has been changed completely.. for example to create a new DOM Object in PHP 4 here's the code..
$dom = domxml_new_doc('1.0');

but in PHP5 it should be
$dom = new DomDocument('1.0'); as I figured out by guess work..

also all the underscores in method names have been removed.

the way to print a DOM object in PHP4 was by
echo $dom->dump_mem();

but I don't know how to do it in PHP 5 since there is no documentation at all...

thx.

DOM/XML in PHP5.. found the solution

Posted: Thu Jul 10, 2003 2:39 am
by wolfie2x
the PHP5 beta1 source folder contains one example in php5-beta1/ext/dom/examples folder. this gives how to use DOM/XML manipulation in PHP5.

echo $dom->savexml();

can be used to dump an xml document..