XML解析错误:未定义的实体 
位置:file:///home/ch/Desktop/abc.xml 
行:1,列:80:<?xml version="1.0" encoding="UTF-8"?><message><show><panduan>0</panduan><info>&nbsp;&nbsp;&nbsp;&nbsp;南亚&nbsp;&nbsp;&nbsp;&nbsp;东亚&nbsp;&nbsp;&nbsp;&nbsp;中东</info></show></message>
兄弟第一次在ajax的返回中使用xml,由于得到的req.responseXML为null,但req.responseText确能得到值,于是把req.responseText得到的值直接用浏览器打开,就有了上述的错误

解决方案 »

  1.   

    貌似是格式错误&nbsp;&nbsp;&nbsp;&nbsp; 这是什么东西?
      

  2.   

    这个DD是空格
    如果要在xml中加空格,怎么弄?
      

  3.   

    这段xml代码是没有错误的,是不是在生成在该xml代码时的格式错误,不是text/xml,而是text/html,从而导致
    req.responseXML为null,而req.responseText有值。
      

  4.   

    在servelt的dopost方法里,已经加了
    response.setContentType("text/xml; charset=UTF-8");  
    response.setHeader("Cache-Control", "no-cache");
    但在jsp页面用req.responseXML得到的仍是null
      

  5.   

    现在问题的原因找到了,就是在xml中使用了&符号,我还发现,如果在xml中使用了<>符号,在jsp页面用req.responseXML得到的就是null,如果把&和<>符号去掉,req.response.XML就能得到传递的值怎样才能用XML传递&,<,>等符号?