ok after removing the header i dont get the above error,but if i view source i still get that whitespace or 8-bit char shown up...
Main Topics
Browse All Topicsim building my own trackback class for my personal blog.
when i try calling my trackback URL like this: http://localhost/my-blog/t
XML Parsing Error: xml declaration not at start of external entity
Location: http://localhost/my-blog/t
Line Number 1, Column 2: <?xml version="1.0" encoding="UTF-8"?>
-^
when i look at the source code, i dont have any whitespaces. i have checked every line of my code over and over again incase i missed one hiding...
i searched on the web and read that a 8-bit character can be inserted infront of the XML declaration tag but i dont know how it could have?
if i create another example like below it works fine...
<?php
function test()
{
$xmlWrite = '';
$xmlWrite .= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
$xmlWrite .= "<test>";
$xmlWrite .= "<success>works fine...</success>";
$xmlWrite .= "</test>";
return $xmlWrite;
}
header("Content-type: text/xml");
echo test();
?>
please see my original code below. I know most of this is PHP so ive included this question in the PHP zone too...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: nitinsawhneyPosted on 2007-11-22 at 02:52:14ID: 20333673
Hi,
;
Looks like a header conflict in your code.
Just remove header("Content-type: text/xml"); from your code and it should do the trick.
If it doesn't work then add another "\n" to following line in the function receive
$return = '<?xml version="1.0" encoding="utf-8"?>'."\n\n"
Cheers!