Page 1 of 1

DOMDocument Problem

Posted: Fri Aug 15, 2008 8:44 am
by darkandlong
Hello,

Trying to use DOMDocument and the following fails to echo anything,

<?php

$dom = new DOMDocument('1.0', 'iso-8859-1');
echo $dom->saveXML();

?>

Does this mean something is missing from my installation of PHP (5.2)?

Thanks.

Re: DOMDocument Problem

Posted: Fri Aug 15, 2008 3:19 pm
by Zoxive
Are you sure it doesnt echo out anything? did you view the source of the webpage.

(Right click view page source in firefox.. etc)

If still nothing then you should at least be getting some errors.

Try..

Code: Select all

<?php
 
error_reporting(E_ALL);
ini_set('display_errors',TRUE);
 
echo '<pre>';
$dom = new DOMDocument('1.0', 'iso-8859-1');
echo $dom->saveXML();
echo '</pre>';