I'll bet five pennies that it's because PHP is trying to interpret the XML declaration. <?php ?> is what PHP should use to start reading text, but <?foo ?>, <?bar ?>, <?baz ?>, <?etc ?>, are all often caught by PHP as well. So's <?xml ?> and <?xml-stylesheet ?>. It's a pet peeve of mine.
This is because of PHP's default of short open tags. See http://www.php.net/manual/en/ini.core.php for details. You probably need to turn them off in your Apache configuration (perhaps by .htaccess).
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary https://alexvincent.us/blog
The short open tag parsing is not smart enough to know that -
<?any_thing_else_here (that is not "php", "=", white-space, or a newline) is NOT an opening php tag.
Either put the <?xml... tag in a string and echo it, escape the ? (I think <\?xml... will work), or turn off short open tags.
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
Its not validating because its not parsing the php. You need to change it from .xml to .php and you also need to pass the right headers. I've taken out the while loop but you should get the idea. You also need a <guid></guid> (click me) on the <item></item>.
PHP Code:
<?php
header("Content-Type: application/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0">
<channel>
<title>Shopping Center Advisor</title>
<link>http://www.shoppingcenter-advisor.com/test
</link>
<description>The definitive source for Shopping Center Information</description>
<language>en-us</language>
<managingEditor>webmaster@shoppingcenter-advisor.com</managingEditor>
<webMaster>webmaster@shoppingcenter-advisor.com</webMaster>
<copyright>2007 Ronald L. McDonald</copyright>
<item>
<title>Test</title>
<description>This is a description</description>
<guid>http://google.com</guid>
<link>
http://google.com
</link>
</item>
</channel>
</rss>