I have an XML feed that I created using XMLWriter . It works flawlessly in dev on the PHP 5.6 firewall. On a real server running PHP 5.4, the feed cannot display a message:
This page contains the following errors: error on line 3 at column 6: XML declaration allowed only at the start of the document
If you are viewing the source, it looks like this:

Somehow, a couple of lines are added to the XML document. The only difference between the servers is the version of PHP (as far as I know).
Here are the first few lines of XMLWriter code:
$xml = new XMLWriter(); $xml->openURI('php://output'); $xml->startDocument("1.0"); $xml->setIndent(true); $xml->startElement("propertyList"); $xml->writeAttribute('date', date('YmdH:i:s'));
Any ideas how to get around this?
user101289
source share