Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 10th, 2006, 12:35 PM
J˙Giusł vs ::NRG::ius
Guest
 
Posts: n/a
Default Warning: domdocument() expects at least 1 parameter

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.




  #2  
Old August 10th, 2006, 12:35 PM
J˙Giusł vs ::NRG::ius
Guest
 
Posts: n/a
Default 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();
?>




  #3  
Old August 10th, 2006, 05:25 PM
Iain Adams
Guest
 
Posts: n/a
Default 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();
?>
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles