2

I used the tutorial listed here to parse my XML:

http://android-er.blogspot.com/2010/05/simple-rss-reader-iii-show-details-once.html

The problem I am having is when I try to read in the XML description tag all I get is this:

<

The "<" symbol is where the description should go. This is the feed I am reading: http://www.calvaryccm.com/rss/devos.ashx

Please help me solve my issue in getting the real text into the description. Thank you!

Courtney Stephenson
  • 912
  • 2
  • 18
  • 43

3 Answers3

2

I just created an android project in eclipse using the code I downloaded from the site you listed above. I only made one modification to the original sources. I changed line 33 in AndroidRssReader.java to read:

            URL rssUrl = new URL("http://www.calvaryccm.com/rss/devos.ashx");

The feed loads and parses fine. enter image description here

The parsing error is the result of changes you made to the original sources.

slayton
  • 20,123
  • 10
  • 60
  • 89
  • What is supposed to happen is the link is clicked (EX: Bring Us Back) then it goes to a detail view with the title description and link. The issue is in the detail view not the main view. – Courtney Stephenson Sep 15 '11 at 19:13
  • If you go back and look at the blog post where the sources came from quite a few people are leaving comments complaining that the parser doesn't work with richtext or html tags. I'd suggest finding another example or contacting the original author to see if he/she has come up with a fix. – slayton Sep 15 '11 at 19:22
1

I found out that I need to wrap my RSS tags in CDATA Tags as shown here:

Writing input for .NET web services

Community
  • 1
  • 1
Courtney Stephenson
  • 912
  • 2
  • 18
  • 43
1

If the data is html encoded, you can use one of the following methods -- or if it is unencoded, you can surround the content in CDATA tags.

Spanned spannedContent = Html.fromHtml(htmlString);
textView.setText(spannedContent, BufferType.SPANNABLE);

or

WebView webview = (WebView) findViewById(R.id.aWebView);
String htmlString = "<html><body>Some html</body></html>";
webview.loadData(htmlString, "text/html", "utf-8");
Timothy Lee Russell
  • 3,719
  • 1
  • 35
  • 43