[英]Java Xml Parser In Android
我收到XML格式的回應
<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 & 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 & 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>
我編寫了一個解析器來從response中檢索數據。
但是問題是。當我在2.1設備上對此進行測試時,它的工作原理如下,我在Android 2.2,Android 2.2.1上進行了測試。 誰能告訴我是什么問題
<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
部分中,或者將&
標記轉換為&
&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 &
:
<link>
http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7
</link>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.