XML parsing error: XML processing directives are not at the beginning of an entity
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 ();
$this->view->xml = $xmlfile;
Write only one sentence at the top of the view:
And then a tune, Haha, success.
The above describes the XML parsing Zend output to produce XML parsing errors, including the content of XML parsing, I hope that the PHP tutorial interested in a friend helpful.