Zend output produces XML parsing errors. XML parsing error: the xml processing instruction is not in the starting part of the object:... publicxmlget row: 2, column: 1 :? Xmlversion1.0? ^ After careful check, it is found that the first behavior is empty. XML parsing error found: the xml processing instruction is not at the beginning of the object.
Location: http: //.../public/xml/get
Row: 2, column: 1:
^
After careful check, it is found that the first behavior is empty. After searching for a long time, I did not find out where the zend view outputs a blank line, including initializing a new View. but I still did not find the reason, but the first line of the website homepage is not empty.
There are similar examples on the Internet, but the solution is to control the output, but I don't know how to control the output of the View. After half a day, I was not successful. I almost collapsed. I decided to give up this method, but first write the xml file to the server and then call it. Obviously, this will reduce the website's performance.
After changing the method, I tried to find a solution. I looked for PHP memory-related information and tried to add ob_end_clean (); to 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;?>
Then try again. haha, it's successful.
Region location: http: //.../public/xml/get row: 2, column: 1 :? Xml version = "1.0 "? ^ After careful check, it is found that the first behavior is empty. Found...