You are here: Re: Using DOM object, how? « PHP « IT news, forums, messages
Re: Using DOM object, how?

Posted by David Robley on 09/19/05 11:09

Ken Tozier wrote:

> I was looking at the PHP DOM documentation here "http://www.php.net/
> manual/en/ref.dom.php" (which is rather sparse in the way of
> examples) and can't even get to square one.
>
> Here's an example from the php site:
>
> <?php
> $doc = DOMDocument::loadXML('<root><node/></root>');
> echo $doc->saveXML();
>
> $doc = new DOMDocument();
> $doc->loadXML('<root><node/></root>');
> echo $doc->saveXML();
> ?>
>
> Problem is, it chokes on the first line with the error:
> Fatal error: Undefined class name 'domdocument' in /folder/
> dom_test.php on line 1
>
> Anyone know how to use this thing?
>
> Thanks

The first line of that page - " The DOM extension is the replacement for the
DOM XML extension from PHP 4." makes me suspect that it may be a PHP 5
feature, and sure enough, a look in the changelog confirms this.

php.net/ChangeLog-5.php#5.0.0b1

So if you are using php < 5.0, that would explain your error.



Cheers
--
David Robley

Be nice to your kids. They'll choose your nursing home.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация