I would like to read RSS feed by following coding:

        /** Get data from the list feed */
        private void GetListFeed() {
                // Get the XML
                URL url;
                try {
                        String ListFeed = getString(R.string.rss_blog);

                        url = new URL(ListFeed);

                        URLConnection connection = url.openConnection();

                        HttpURLConnection httpConnection = (HttpURLConnection) 
connection;
                        httpConnection.setReadTimeout(5000);

                        int responseCode = httpConnection.getResponseCode();

                        if (responseCode == HttpURLConnection.HTTP_OK) {

                                InputStream in = 
httpConnection.getInputStream();

                                DocumentBuilderFactory dbf = 
DocumentBuilderFactory
                                                .newInstance();
                                DocumentBuilder db = dbf.newDocumentBuilder();

                                // Parse the feed.
                                Document dom = db.parse(in);
                                Element docEle = dom.getDocumentElement();

                                // Get a list of each entry.
                                NodeList nl = 
docEle.getElementsByTagName("item");
                                if (nl != null && nl.getLength() > 0) {
                                        int k = nl.getLength();

                                        for (int i = 0; i < k; i++) {
                                                Element entry = (Element) 
nl.item(i);

                                                        Element title = 
(Element) entry
                                                                        
.getElementsByTagName("title").item(0);

                                                        Element description = 
(Element) entry
                                                                        
.getElementsByTagName("description")
                                                                        
.item(0);;

                                                        strTitle = 
title.getFirstChild().getNodeValue()
                                                                        
.trim().toString();

                                                        strDescription = 
description.getFirstChild()
                                                                        
.getNodeValue().trim().toString();



                                                }

                                        }
                                }

                        }
                } catch (MalformedURLException e) {
                        e.printStackTrace();
                } catch (IOException e) {
                        e.printStackTrace();
                } catch (ParserConfigurationException e) {
                        e.printStackTrace();
                } catch (SAXException e) {
                        e.printStackTrace();
                } finally {
                }
        }

However, it description contains html symbol, such as <br />, it will
stop read and display any thing before it.
For example: abc defg hi <br /> jkl mn opq
At android device, it will shows "abc defg hi" only.

I would appreciate if you guys can help me solve this issue. .....



-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to