Reply to Re: [PHP] simple DOM/XML test fails in php

Your name:


Posted by "Richard Lynch" on 01/20/06 23:14

On Fri, January 20, 2006 10:20 am, Larry Hughes wrote:
> I have a very simple DOM test set up which is failing. Environment is
> apacie 1.3.x, WIN xp, PHP 5.1.2 ; DOM seetings outlined in phpinfo()
> indicate various DOM/XML support is enabled.
> Failing php is:
> <?php
> $dom = new DOMDocument('1.0', 'iso-8859-1');
> echo $dom->saveXML();
> ?>
> which results in:
> The XML page cannot be displayed
> Cannot view XML input using style sheet. Please correct the error and
> then
> click the Refresh button, or try again later.
> --------------------------------------------------------------------------------
> XML document must have a top level element. Error processing resource
> ''.

Seems pretty clear.

You need to put something *IN* your DOMDocument to have it be valid.

A totally empty document is not valid XML.

Add some line between the 2 lines you have, and do something with the
$dom to add something to it. No idea how you do that, mind you, but
it's what you need.

Like Music?

[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

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