简体   繁体   English

XML 的差异导致我的 android 应用程序崩溃

[英]difference in XML feeds something is crashing my android app

I was using a test xml feed for my android app and when I tried my own xml feed now my app crashes.我正在为我的 android 应用程序使用测试 xml 提要,当我尝试自己的 xml 提要时,我的应用程序崩溃了。

test feed:测试饲料:

http://p-xr.com/xml/

my feed:我的饲料:

http://www.patriotsar.com/quotes.xml

I noticed that when I view the test feed (in a browser) there is no XML formatting or lack of.我注意到当我(在浏览器中)查看测试提要时,没有 XML 格式或缺少。 But when I view the test feed it looks like html.但是当我查看测试提要时,它看起来像 html。

I am grabbing the XML using:我正在使用以下方法获取 XML:

HttpPost httpPost = new HttpPost("http://www.patriotsar.com/quotes.xml");

Your XML has 3 extra tags:您的 XML有 3 个额外标签:

 <html>
  <head/>
      <body>
      <sfdocready id="sfDocReady"/>
     </body>
 </html>

Where as the test XML does not.测试 XML没有。

You can view the text XML properly by going to the web address then right clicking on the page and pressing 'View Source' (Google Chrome)您可以通过转到 web 地址然后右键单击页面并按“查看源代码”(Google Chrome)来正确查看文本 XML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM