Reply to Re: [PHP] Error with DOMDocument->saveXML()

Your name:

Reply:


Posted by Stephen Leaf on 09/29/05 17:32

On Thursday 29 September 2005 04:20 am, Andy Pieters wrote:
> Hi
>
> > <b>Fatal error</b>: Method Document::__toString() must return a string
> > value in <b>/srv/www/localhost/htdocs/db/index.php</b> on line
> > <b>140</b><br />
>
> That's just what it says, check your program flow.
>
> You overrided the tostring function and somewhere in that new function you
> jump out of it because of a flag that is set, and thus not returning
> anything, which is equal to return null.
I'd love to say that is possible however it's not.
function __toString() {
# Transform...
if (!$this->outXML) {
$XSlt = new xsltprocessor();
$XSlt->registerPHPFunctions();
$XSlt->importStyleSheet(DomDocument::load($this->style));
return $XSlt->transformToXML($this->Dom);
} else {
return $this->Dom->saveXML();
}
}
As you can see there is nothing that could make it jump out. very straight
forward and all cases handled via else.
The line: return $this->Dom->saveXML(); is somehow returning null.

Thank you for the advice on how to enable notices.
being I always include my Document script I just added
error_reporting(E_ALL); to the top.

Sadly I'm getting no Notices about my problem. Am getting 1 notice but nothing
of any interest

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация