Java的XML解析器在Android中

问题描述:

我得到XML格式Java的XML解析器在Android中

<item> 
<title> 
<![CDATA[ 
28. Februar 2013, FY/Q4 2012 Investoren-Telefonkonferenz 
]]> 
</title> 
<author> 
<![CDATA[ BAYER AG - Investorveranstaltungen ]]> 
</author> 
<pubDate>Thu, 28 Feb 2013 12:00:00 +0100</pubDate> 
<description> 
<![CDATA[ 
Rede von Dr. Marijn Dekkers, Vorsitzender des Vorstands der Bayer AG, Investoren-Telefonkonferenz zu den Ergebnissen des Geschaeftsjahres und des 4. Quartals 2012. (Auf... 
]]> 
</description> 
<link> 
http://www.webvideo.bayer.com/downloads/9208/9212/12312/file.mp3 
</link> 
<content:encoded> 
<![CDATA[ 
<p>Rede von Dr. Marijn Dekkers, Vorsitzender des Vorstands der Bayer AG, Investoren-Telefonkonferenz zu den Ergebnissen des Geschaeftsjahres und des 4. Quartals 2012. (Auf Englisch)</p> 
]]> 
</content:encoded> 
<category>ISIN_DE000BAY0017</category> 
<category>ISIN_DE000BAY0017</category> 
<category>podcast</category> 
</item> 
<item> 
<title> 
<![CDATA[ 
2013-01-30 - Analyst &amp; Investor Conference - Welcome Marc Spieker, Head of Investor Relations 
]]> 
</title> 
<author> 
<![CDATA[ E.ON Podcast ]]> 
</author> 
<pubDate>Wed, 30 Jan 2013 15:00:00 +0100</pubDate> 
<description> 
<![CDATA[ Analyst &amp; Investor... ]]> 
</description> 
<link> 
http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7 
</link> 
<content:encoded> 
<![CDATA[ <p>Analyst & Investor Conference</p> ]]> 
</content:encoded> 
<category>ISIN_DE000ENAG999</category> 
<category>ISIN_DE000ENAG999</category> 
<category>podcast</category> 
</item> 

一个响应我写一个分析器,从响应检索数据。

但问题是。当我在2.1设备上测试这个,它的工作原理如下,我测试了Android 2.2,它的工作正常。任何机构可以告诉我什么问题

<link> 
     http://www.webvideo.bayer.com/downloads/9208/9212/12312/file.mp3 
    </link> 

我能够找回在另一起案件中的链接是否正确 但是,当我失败

<link> 
    http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7 
    </link> 

当我分析的结果是

http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367 

&以后的数据缺失。我只在android 2.1中看到这个。有人建议我可能会出错吗?

大概链接文本还应在CDATA截面,或者具有转换为&amp;

&presentation_id...&马克被认为是一个(未解析的)XML实体。

溶液1(含CDATA):

<link> 
    <![CDATA[http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7]]> 
</link> 

溶液2与&amp;

<link> 
    http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&amp;presentation_id=d43466300a1a8ced8324011b593fb05a&amp;video_id=24ae8f409449411695c0729760646bf7 
</link> 
+0

有任何方法正确地获取链接?? – edwin 2013-03-05 11:42:00

+0

尝试更改服务器输出。我在答案中列举了一些例子。 – gaborsch 2013-03-05 11:43:33

+0

好的,谢谢你,我会尝试 – edwin 2013-03-05 12:20:42