|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-24 03:51 UTC] graha at phoenixfly dot com
[2008-07-26 11:28 UTC] bjori@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 13:00:01 2025 UTC |
Description: ------------ I am trying to read an XML document. I have found several online examples for achieving this, as well as in the PHP Manual. Everyone does the first steps the same, and yet, when I attempt this it fails. As far as I can tell, I have the DOM class since it is provided with the base PHP, and also because I did specifically select the DOM portion of the PHP install (to ensure I have what I need). I get one Warning and one Fatal. Reproduce code: --------------- <html> <head> <title>PHP XML Reader</title> </head> <body> <!-- Read XML Here --> <?php $xmlDoc = new DOMDocument(); // PHP Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in C:\\wwwroot\\TestSetup\\PHP_XMLReader.php on line 8 $xmlDoc->load('test.xml'); // PHP Fatal error: Call to undefined method domdocument::load() in C:\\wwwroot\\TestSetup\\PHP_XMLReader.php on line 10 echo '<p>"'. 't' .'"</p>'; ?> </body> </html> Expected result: ---------------- I expected my webpage to display "t"... but it is crashing when i attempt to load the xml file. Actual result: -------------- Nothing happend. error log reported: PHP Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in C:\\wwwroot\\TestSetup\\PHP_XMLReader.php on line 8 PHP Fatal error: Call to undefined method domdocument::load() in C:\\wwwroot\\TestSetup\\PHP_XMLReader.php on line 10