Android — Parsing RSS — Mismatched Tag

TiviorryVof

New Member
here is my xml\[code\]<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended" version="2.0"><channel><atom:id>https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic</atom:id><lastBuildDate>Thu, 27 Dec 2012 12:15:54 +0000</lastBuildDate><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Sheet1</title><description/><link>https://spreadsheets.google.com/pub?key=0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc</link><managingEditor>[email protected] (Goappteam)</managingEditor><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/b8lvi</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Mission Trails Regional Park</title><description>timestamp: 8/21/2012 13:13:38, activity: Hiking, city: San Diego, address: Father Junipero Serra Trail/ San Diego/ CA, coordinates: 32.8329863/ -117.0473743, personname: Francisco Martinez</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bbf0c</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Mt Woodson</title><description>timestamp: 8/21/2012 13:20:25, activity: Hiking, city: San Diego , address: 16422 North Woodson Drive/ Ramona/ CA 92065, coordinates: 33.008088/-117.015381, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bctkt</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>El Cajon Mountain Hiking Trail</title><description>timestamp: 8/21/2012 13:21:34, activity: Hiking, city: El Cajon, address: Wild Cat Canyon Rd/ El Cajon/ CA 92021, coordinates: 32.911225/-116.821318, personname: Francisco Martinez</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bqv8z</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Sunset Cliffs</title><description>timestamp: 8/21/2012 13:22:28, activity: Hiking, city: San Diego , coordinates: 32.702956/-117.25296, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bs9tc</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Torrey Pines State Reserve</title><description>timestamp: 8/21/2012 13:23:40, activity: Hiking, city: San Diego , coordinates: 32.930318/-117.25708, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/btodt</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Ramona Waterfall</title><description>timestamp: 8/21/2012 13:24:33, activity: Hiking, city: San Diego , coordinates: 32.995851/-116.756001, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bl8zb</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Cowles Mountain</title><description>timestamp: 8/21/2012 13:27:45, activity: Hiking, city: San Diego , coordinates: 32.814978/-116.998901, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bmnjo</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Daley Ranch</title><description>timestamp: 8/21/2012 13:28:37, activity: Hiking, city: San Diego , coordinates: 33.165145/-117.047653, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/c0p7u</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Iron Mountain</title><description>timestamp: 8/21/2012 13:31:18, activity: Hiking, city: San Diego , coordinates: 32.978428/-116.972122, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/c3ico</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Los Penasquitos Canyon</title><description>timestamp: 8/21/2012 13:32:11, activity: Hiking, city: San Diego , address: 12115 Black Mountain Rd/ San Diego/ CA 92129, coordinates: 32.9383501/ -117.1278391, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/bv2y6</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>Anza-Borrego Desert State Park</title><description>timestamp: 8/21/2012 13:44:39, activity: Hiking, city: San Diego , address: 200 Palm Canyon Drive/ Borrego Springs/ California 92004, coordinates: 33.257261/ -116.406219, personname: Yousuf Ghanim</description></item><item><guid isPermaLink="false">https://spreadsheets.google.com/feeds/list/0Aj1nMnnb7M-TdDBFT2tmeUVNSHE3OWRjMkxYS1lRMHc/od6/public/basic/cokwr</guid><atom:updated>2012-12-27T12:15:54.182Z</atom:updated><category domain="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006#list</category><title>101 Park</title><description>activity: Test, city: LOL, address: 123 Testing Avuie/ Lol/ Hey/ California 0123, coordinates: 33.257261/ -116.406219</description></item></channel></rss>\[/code\]I am trying to parse through it to get the Title and the Description and dispaly them in aListView, here is my Java code, any idea? The error says Mismatched Tag, doesn't it skip tags that are not specified by me?\[code\]try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); url = new URL(feedUrl); xr.setContentHandler(this); xr.parse(new InputSource(url.openStream())); } catch (IOException e) { Toast.makeText(context, "IOException", Toast.LENGTH_SHORT).show(); Toast.makeText(context, e.getMessage().toString(), Toast.LENGTH_SHORT).show(); Log.e("RSS Handler IO", e.getMessage() + " >> " + e.toString()); } catch (SAXException e) { Toast.makeText(context,"SAXException", Toast.LENGTH_SHORT).show(); Toast.makeText(context, e.getMessage().toString(), Toast.LENGTH_SHORT).show(); Log.e("RSS Handler SAX", e.toString()); } catch (ParserConfigurationException e) { Toast.makeText(context, "ParserConfigurationException", Toast.LENGTH_SHORT).show(); Toast.makeText(context, e.getMessage().toString(), Toast.LENGTH_SHORT).show(); Log.e("RSS Handler Parser Config", e.toString()); }\[/code\]By the way, The reason for this is that I want to display the contents of a google spreadsheet in the ListView, the problem is that Android has problems connecting to a secured connection server, so I am hosting the resulting xml in a different location then downloading it in my app.
 
Back
Top