[thelist] [XML] PHP creation of XML.. not starting at top of page..?

Mark Groen evolt at markgroen.com
Tue May 20 08:34:38 CDT 2008


On Tuesday 20 May 2008 06:05:47 Nan Harbison wrote:
> Tris,
>
> There is an error message on the page, so we can't see what you are talking
> about.
-----------
> So I can see that there's a line, but if I remove that line to give:
> ?><?=$showXml ?>
>
> there's still 3 spaces that appear tio be invalid.

That error message shows the problem: it's not valid xml - "<?xml" must be the 
first characters encountered in the newly created file. Guessing that at the 
_very_top_ of your php code there is this line missing:

<?php header('Content-type: text/xml');

If that doesn't work, would need to see more of your code.

Just a heads up too, using "short tags" (<?) instead of <?php can run you into 
trouble down the road if using Apache/PHP, short tags are not the default and 
if moving your code to a different server your program may break.
--
cheers,

	Mark
--



More information about the thelist mailing list