XML parsing error: XML processing directives are not at the beginning of an entity
Location: Http://.../public/xml/get
Line: 2, column: 1:
^
After careful examination, it was found that the first act was empty. Looking for a long time not to find out exactly where the Zend view output a blank line, including initializing a new view, but never find the reason, but the first line of the site home page is not empty.
There are similar examples on the web, but the solution is to pay attention to the control output, but I don't know how the View controls the output. For a long while did not succeed, I almost collapsed, I decided to abandon this method, and first write the XML file to the server and then call. Obviously this will degrade the performance of your site.
After changing the method, I try to find a solution, I find the PHP memory-related information, try to put Ob_end_clean (); Added before the output, as follows:
$xmlfile = $doc->savexml ();
$doc->save ("Data.xml");
Ob_end_clean ();
$this->view->xml = $xmlfile;
Write only one sentence at the top of the view:
XML;?>
And then a tune, Haha, success.
http://www.bkjia.com/PHPjc/319953.html www.bkjia.com true http://www.bkjia.com/PHPjc/319953.html techarticle XML Parsing error: The XML processing instruction is not at the beginning of the entity: Http://.../public/xml/get: 2, Column: 1:?xml version= "1.0"? ^ After careful examination, the first act is found to be empty. Looking for a ...