$doc = new DOMDocument();
if ($doc->load('http://foo.com/bar.xml')) {
// good
} else {
// wtf happened?
}
I can wget http://foo.com/bar.xml
from the location where the PHP code is running, so I know the URL is accessible. I'm thinking it must be something other than an HTTP error.
I'm not sure what else could be causing the failure. Maybe a parsing issue? The XML appears to be valid (and passes W3C's validation test). As far as I can tell from the documentation, there's no way to determine why the load failure occurred.
Here's the XML:
<response>
<version>8</version>
<minversion>1</minversion>
<url>api.asp?</url>
</response>