哎哟,约3小时挖掘和分析你的源代码后,我发现你为什么有这样一个奇怪的结果,像上面的原因。
首先看看来自链接的RSS内容你解析:http://app.calvaryccm.com/mobile/android/v1/devos
其内容的某些部分:
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>CCM Daily Devotions</title> <link>http://www.calvaryccm.com/resources/dailydevotions.aspx</link> <description>Calvary Chapel Melbourne's Daily Devotionals</description> <webMaster>[email protected] (Calvary Chapel Melbourne)</webMaster> <copyright>(c)2011, Calvary Chapel Melbourne. All rights reserved</copyright> <ttl>60</ttl> <item> <guid isPermaLink="false">b3e91cbf-bbe9-4667-bf4c-8ff831ba09f1</guid>
<title>Teachable Moments</title> <description>Based on &ldquo;Role Models, Part 4&rdquo; by Pastor Mark Balmer; 10/8-9/11, Message #6078; Daily Devotional #6 - &ldquo;Teachable Moments&rdquo; Preparing the Soil (Introduction): My husband and I took seriously our understanding of God&rsquo;s instructions to teach His commandments to our children. (Deuteronomy 6:7) We went to our local Christian bookstore and bought children&rsquo;s Bibles, studies, coloring books, games&mdash;anything that would help us to communicate biblical situations in their lives. Planting and Watering the Seed (Growth): Each parent needs to take seriously God&rsquo;s commthe Crop (Action/Response): Life is God&rsquo;s classroom for teachable moments. A long delay in traffic can be a frustrating irritation, or it can be an opportunity to teach our children that God&rsquo;s than taught. Cultivating (Additional Reading): Psalm 78:1-8;&nbsp;Psalm 145:4 klw Calvary Chapel of Melbourne; 2955 Minton Road; W. Melbourne, FL 32904; 321-952-9673 NLT = New Living Translation. </description> <link>http://www.calvaryccm.com/resources/dailydevotions.aspx</link> <pubDate>Sun, 16 Oct 2011 12:00:00 GMT</pubDate> </item>
注重紧密合作,以这个标签/rss/channel/item/description
,你能看到的是这些东西:rsquo;
或'squo;
或&
或ldquo;
或rdquo;
...这些是转义字符(左单引号,右单引号,&符号,右双引号,左双引号e引用...甚至是新行),它们都驻留在XML内容中。
所以当XML Parser
通过这些字符时,它认为要逃避解析,这会导致你现在面临的怪异结果。
解决方案如何?起初,我可以考虑首先获取URL
的内容,然后使用这些字符(添加SLASH字符),现在我认为您可以再次成功解析它。
但是,这种解决方案似乎工作得很好,但我认为它可能不会,因为来自服务器的RSS文本内容响应格式很奇怪(格式不正确)。因此,如果您可以联系此Web管理员,请在发布RSS订阅前告诉他们很好地格式RSS content
(如添加SLASH以转义字符,删除所有NEW-LINE字符...)。
其他的解决方案是使用手柄逃避某些第三方/转义东西像StringEscapeUtils
从Apache Commons
:http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/StringEscapeUtils.html或JTidy
。
但我不认为这些库在你的情况下效果最好。
这就是我所能说的。
@ p/s:对您的源代码只是一些评论,我认为您需要考虑清楚您的代码以便阅读,更好地进行维护,并适当重新打包。
您是否使用与示例相同的代码?如果您编辑了代码,请在此处提供。 –
你想从描述标签中得到什么值?和任何其他值 –
“对不起,此下载链接不再存在”....来自http:// justbeamit.com/95152' –