xml parsing using DOM in android
<p>Iam working on Rss feeds.Iam using DOM parser</p>

<pre><code>The actual link is:

http://news.google.com/news/url?sa=t&amp;fd=R&amp;usg=AFQjCNEd3ZGNLp5P-6bn44JmKbPfQimTyQ&amp;url=http://www.foxnews.com/world/2012/09/21/libyans-storm-ansar-al-sharia-compound-in-backlash-attack-on-us-consulate/

After executing the function    xml = parser.getXmlFromUrl(URL);
URL=https://news.google.com/news/feeds?ned=us&amp;topic=w&amp;output=rss



In xml Iam getting the link as:

http://news.google.com/news/url?sa=t&amp;amp;fd=R&amp;amp;usg=AFQjCNHrclA7rxiQuEvAA_o9ZDRlZQFLkg&amp;amp;url=http://www.usatoday.com/news/world/story/2012/09/21/libyans-storm-militia-in-backlash-of-attack-on-us/57821580/1
</code></pre>

<p>when I pasted this url in browser it is showing "This is an invalid url".</p>

<pre><code>How to get the a valid url? Could anyone please help me.
</code></pre>

<p>Below function is to get xml from url:</p>

<pre><code>public String getXmlFromUrl(String url) {
        String xml = null;

        try {
            // defaultHttpClient
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(url);

            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            xml = EntityUtils.toString(httpEntity);

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        // return XML
        return xml;
    }
</code></pre>
