Newbie Problem with XML DOM

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I am creating my first PHP page, using it to read in an XML file, take
form input, generate a new node, and add it to the file.
Unfortunately, I am having problems with the domxml_open_file function.
 As soon as I reach that line in my script, the whole thing aborts with
no error message, and doesn't bother even with the rest of the HTML on
the page.  I have a file calendar.xml in the same directory with the
calendar.php page that I am trying to load.  I do a bunch of reading of
the $_POST variable (which works fine), then I have:

$xmlpath = dirname(__FILE__) . "/";
echo "<h1>" . $xmlpath . "</h1>";
domxml_open_file($xmlpath . "calendar.xml");

The $xmlpath variable echos to the screen, but no other output is
displayed.  If I comment the domxml_open_file line, then the rest of
the page is displayed as normal.  I have also tried the syntax

$errors = "";
domxml_open_file($xmlpath . "calendar.xml", DOMXML_LOAD_PARSING,

with no better results.  The configure command for the PHP installation
includes "'--with-dom=shared,/usr" so I know the DOM is installed.  I'm
sure this is something very simple; please, someone with PHP
experience, enlighten me!

Many thanks
Claus Hetzer

Re: Newbie Problem with XML DOM wrote:
Quoted text here. Click to load it

If there is additional code after this which does not get executed, then
most likely you're encountering a fatal error and have the display of
error messages turned off.

Turn on error logging and watch the log file, or set display of errors
on for debugging purposes.

Calling an undefined function is a fatal error; check with
function_exists() look in the phpinfo() output that the domxml module is
actually present.

Quoted text here. Click to load it

This means the domxml module was built as a shared library; typically
this is done so modules can be packaged separately from the main
installation. If you're using Debian or Ubuntu Linux for instance, make
sure the php4-domxml package is installed.

-- brion vibber (brion @

Site Timeline