XML parsing error: the XML Processing Instruction is not at the beginning of the object.
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. 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:
<? = $ This-> XML;?>
Then try again. Haha, it's successful.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.