Connecting Tech Pros Worldwide Help | Site Map

Warning: domdocument() expects at least 1 parameter

J˙Giusł vs ::NRG::ius
Guest
 
Posts: n/a
#1: Aug 10 '06
Hi all.

I have this script

-----------------------------------------------------------
<?php
$doc = new DOMDocument();
$doc->load('books.xml');
echo $doc->saveXML();
?>
-----------------------------------------------------------


But when I run it I get this ugly message...

-----------------------------------------------------------
Warning: domdocument() expects at least 1 parameter, 0 given in
C:\Programmi\Apache Group\Apache2\htdocs\app\aiml\book.php on line 2
Fatal error: Call to undefined function: load() in C:\Programmi\Apache
Group\Apache2\htdocs\app\aiml\book.php on line 3
-----------------------------------------------------------

My php version is 4.3.8 (with Apache 2.0 on windows 2000).

Any ideas?

Many thanks.

Gius.




J˙Giusł vs ::NRG::ius
Guest
 
Posts: n/a
#2: Aug 10 '06

re: Warning: domdocument() expects at least 1 parameter


I tried to add version number of the instance document and his encoding
but nothing................
........
<?php
//$doc = new DOMDocument();
$dom = new DOMDocument('1.0', 'iso-8859-1');
$doc->load('books.xml');
echo $doc->saveXML();
?>




Iain Adams
Guest
 
Posts: n/a
#3: Aug 10 '06

re: Warning: domdocument() expects at least 1 parameter


Try this again, dont think you noticed but u called the new DOMDocument
$dom instead of $doc;


J˙Giusł vs ::NRG::ius wrote:
Quote:
I tried to add version number of the instance document and his encoding
but nothing................
.......
<?php
//$doc = new DOMDocument();
$dom = new DOMDocument('1.0', 'iso-8859-1');
$doc->load('books.xml');
echo $doc->saveXML();
?>
Closed Thread