parsing - Android SAX parser not getting full text from between tags -


I created my own default handler for parsing the RSS feed and it works fine for most feeds for ESPN However, due to URL ESPN formats, the portion of the article URL is cut off due to the URL. An example of a full article url from ESPN.

  http://sports.espn.go.com/nba/news/story?id=5189101&aign=rss& Source = ESPN headline  

The problem is for some reason the default handler character method is only getting it from the tag that contains the URL above.

  http: //sports.espn.go.com/nba/news/story?id=5189101  

As you can see, this The ampersand escape code is cutting all the contents of the url and later. How can I disconnect my string on this escape code to the SAC parser? Here is my letter method for referee.

  public zero character (four f [], integer start, full length) {string character = (new string (ch.) Start + length)); Try {// if not in the item, the title / link refers to the feed if (! InItem) {if (inTitle) currentFeed.title = character; } Else {if (inLink) currentArticle.url = new URL (character); If (inTitle) currentArticle.title = character; If (inDescription) currentArticle.description = characters; If (inPubDate) currentArticle.pubDate = Characters; If (inclination) {}}} catch (malmarmdoor lexception e) {Log.e ("RSSRD", ettstring ()); }}  

Rob W.

As you can see, this is cutting everything from the URL with the ampersand escape code is.

. SAX parsers can return all equivalent character data in a single section, or they can divide it into several segments; However, all the characters in a single event should come from the same external unit so that the locator can provide useful information.

{If (buf! = Zero) {for (int i = start; i & lt; start + length; i ++) {buf to attach invalid characters (four f [], integer start, full length) Append (ch [i]); }}

Then in endElement () , I take the contents of the StringBuilder and do something with it like this, if parser letters () calls many times, so I do not remember anything.


Comments