This is an intermittent problem:
Warning: xmldoc(): EntityRef: expecting ';'
My code posts some XML in an array,
reads the response into an array,
implodes it into a string,
strips off the header and,
everything past the last XML element in the response,
and creates a DOM tree.
At the the point were I say:
if (!$doc = xmldoc($result_str)) {
die("Error in XML document");
}
...it either works without complaint, or throws this warning and dies. In 10 attempts, I get three warnings, on average.
The only variable is what's coming back from the server...the XML contains varying numbers of elements, with slightly differing different character data (but no difference in the type of characters). I can't see any obvious relationship between the response string and the failures.
I'm using url encoding for the POST, because I can't get text/xml to work with this server, but that's not really a problem...I don't believe.
The XML appears to be well formed, and there are no characters before the first tag or after the last tag, when it's given to xmldoc().
Has anyone seen this warning before?
(Google comes back with hits for this warning, only because other sites are broken in the same way)
What causes this?