I get text from an XML file
URL url_Twitter = new URL("http://twitter.com/statuses/user_timelineID_PROVA.rss");
HttpURLConnection conn_Twitter =(HttpURLConnection)url_Twitter.openConnection();
DocumentBuilderFactory documentBF_Twitter = DocumentBuilderFactory.newInstance();
DocumentBuilder documentB_Twitter = documentBF_Twitter.newDocumentBuilder();
Document document_Twitter = documentB_Twitter.parse( conn_Twitter.getInputStream());
there are some characters in xml like & # 8217; so when i call
document_Twitter.getElementsByTagName("title").item(2).getFirstChild().getNodeValue()
the string is truncated before such characters
Text is in just one tag.
<item>
<title>SMWRME: Internet per “Collaborare senza confini”. Soprattutto alla SMW di Roma, dal 7 all'11 febbraio. Ecco il terzo percorso. http://cot.ag/ewnJ4F</title>
<description>SMWRME: Internet per “Collaborare senza confini”. Soprattutto alla SMW di Roma, dal 7 all'11 febbraio. Ecco il terzo percorso. http://cot.ag/ewnJ4F</description>
<pubDate>Mon, 27 Dec 2010 20:05:01 +0000</pubDate>
<guid>http://twitter.com/SMWRME/statuses/19483914259140609</guid>
<link>http://twitter.com/SMWRME/statuses/19483914259140609</link>
<twitter:source><a href="http://cotweet.com/?utm_source=sp1" rel="nofollow">CoTweet</a></twitter:source>
<twitter:place/>
</item>
I noticed that this behavior only happens for an Android app. The same code is great for a Java application. Can anybody help me?
source
share