views:

52

answers:

1

I am receiving this XML error:

Only one top level element is allowed in an XML document. Error processing resource...

Accompanied with this PHP error:

Warning:  file_get_contents(...)

It seems straight forward, except it's not reproducible in any way and it's happens 100% on our clients computers (more than 6). Initially I though this was only IE6, but when they upgraded to IE7, it still happened.

While it seems the XML error is triggered by the PHP error, it only happens on IE and never on any other browser. Has anybody run into this and how'd you find it?

+1  A: 

The XML error is because an XML document must have a single root element.

I suspect that the PHP is supposed to generate some XML and then enclose it in something that gives it a single root element, and that the wrapping process is failing. It's a total guess, I think we need more information about what the PHP code is doing to be more specific.

If you can open the problematic resource in Firefox 3.0 instead of IE, you should be able to View -> Source, which will show you the content of the resource. That might help you diagnose the problem. If you can't use Firefox, maybe you can code up a small HTTP client to retrieve the resource and print out the content.

Brabster