Zend 输出产生XML解析错误
XML解析错误:xml处理指令不在实体的开始部分
位置:http://.../public/xml/get
行:2,列:1:
^
仔细检查后发现是首行为空。找了很久没有找到到底 zend 的 view 在哪儿输出了空行,包括初始化一个新的 View ,但是始终没有找到原因,但是网站主页的首行是没有空的。
网上也有类似的例子,但是他们解决的方法是注意控制输出,但是我不知道 View 怎么控制输出。 弄了半天也没成功,我都快崩溃了,我决定放弃这种方法,而先将 xml 文件写到服务器端再调用。显然这样会降低网站的性能。
在改了方法后,我尝试着找一下解决的办法,我找了 PHP 内存相关的资料,尝试着把 ob_end_clean(); 加在了输出 之前, 如下:
$xmlfile = $doc->saveXML();
//$doc->save("data.xml");
ob_end_clean();
$this->view->xml = $xmlfile;
在视图顶部只写一句:
=$this->xml; ?>
然后再一调式,哈哈,成功了。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
