PHP5 DOM/XML trouble!!

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
wolfie2x
Forum Newbie
Posts: 10
Joined: Sun Jul 06, 2003 11:04 pm

PHP5 DOM/XML trouble!!

Post 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
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post 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,
wolfie2x
Forum Newbie
Posts: 10
Joined: Sun Jul 06, 2003 11:04 pm

Post 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.
wolfie2x
Forum Newbie
Posts: 10
Joined: Sun Jul 06, 2003 11:04 pm

DOM/XML in PHP5.. found the solution

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