...

View Full Version : Using DOM XML functions



Actinia
08-27-2007, 01:22 PM
I am trying to convert a string into a DOM tree using:



if ( !$doc = xmldoc($buf) ) {
die("<html><body><p>cannot open XML string</p></body></html>");
}


But all get is nothing! No error messages, no output from later echos.

I am using Apache 2.2 and PHP 5, downloaded in the last two weeks.

Using phpinfo() tells me that the DOM functions are enabled.

John Rostron

shyam
08-27-2007, 01:46 PM
I am trying to convert a string into a DOM tree using:



if ( !$doc = xmldoc($buf) ) {
die("<html><body><p>cannot open XML string</p></body></html>");
}


But all get is nothing! No error messages, no output from later echos.

I am using Apache 2.2 and PHP 5, downloaded in the last two weeks.

Using phpinfo() tells me that the DOM functions are enabled.

John Rostron

don't u mean

if ( !($doc = xmldoc($buf)) )

PappaJohn
08-27-2007, 03:38 PM
Try


if ( $doc != xmldoc($buf) ) {
die("<html><body><p>cannot open XML string</p></body></html>");
}

aedrin
08-27-2007, 05:46 PM
No error messages, no output from later echos.

If PHP comes across an error while reading the PHP, and it is set to not display errors, it will show you a blank screen/empty source.

If you are debugging, turn on error displaying.

Actinia
08-30-2007, 11:46 AM
I have now discovered how to switch on error messages. Despite phpinfo() telling me that DOM is enabled, the message is that the function xmldoc is not recognized.

However, I have downloaded Domit!, and this seems to be doing what I want. It also seems to offer more functionality than the DOM functions. The disadvantage is that it is interpreted rather than a pre-compiled package.

John Rostron



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum