title: Read image url from xml in android
body: <p>I want to read image from this url. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"&gt;
  
    &lt;channel&gt;
  
      &lt;title&gt;podCast411&lt;/title&gt;
      &lt;description&gt;The 411 on podCasts, podCasters and podcasting&lt;/description&gt;
      &lt;link&gt;http://www.podcast411.com&lt;/link&gt;
       ..
       ..
      &lt;itunes:explicit&gt;No&lt;/itunes:explicit&gt;
  
      &lt;itunes:image href="http://www.podcast411.com/img/411_itunes.jpg"/&gt;
       ..
    &lt;/channel&gt;
  &lt;/rss&gt;
  </code></pre>
  
  <p>I can read title,description from this feed using the following code.</p>
  
  <pre><code>Node results = doc.getDocumentElement();
              Element docElement = doc.getDocumentElement();
              NodeList childNodes = docElement.getChildNodes();
              NodeList itemLinks = docElement.getElementsByTagName("item");
              Log.d("TAG",
                      "Response:" + results.getLastChild() + " "
                              + childNodes.getLength() + "  " + itemLinks.getLength());
  
  
              for (int i = 0; i &lt; itemLinks.getLength(); i++) {
                  Element el = (Element) itemLinks.item(i);
  
  
                  NodeList itemTitle = el.getElementsByTagName("title");
                  Element itemFirst = (Element) itemTitle.item(0);
                  String nTitle = itemFirst.getFirstChild().getNodeValue();
  
  
                  NodeList itemdesc = el.getElementsByTagName("description");
                  Element itemFirstdesc = (Element) itemdesc.item(0);
                  String nDesc = stipHtml(itemFirstdesc.getFirstChild().getNodeValue());
  
  }
  public String stipHtml(String html) {
              return Html.fromHtml(html).toString();
          }
  </code></pre>
  
  <p>When i am trying to do the same code for reading an url, it does not work. the below code is for reading imade url:</p>
  
  <pre><code>NodeList itemImage = el.getElementsByTagName("image");
                  String imageUrl = null;
                  for(i=0;i&lt; itemImage.getLength();i++) {
                      Log.d("TAG", "Length of item is "+ itemImage.getLength());
                      Element itemFirstImage = (Element) itemImage.item(i);
                      NodeList url = itemFirstImage.getElementsByTagName("url");
                      Element link = (Element) url.item(i);
                      imageUrl = stipHtml(link.getFirstChild().getNodeValue());
                  }
  </code></pre>
  
  <p>What is wrong in my code?</p>
  
  <p>My logcat is: it is showing for all element.</p>
  
  <pre><code>D/TAG     ( 1901): List Data is called
  D/TAG     ( 1901): Temp is created.......
  D/TAG     ( 1901): RSS Data: title  : Twelve-die-in-Himachal-road-accident description:Twelve people, all belonging to a village in Himachal Pradesh's Chamba district, were killed when a private vehicle skidded off the road and fell into a 700-metre-deep gorge on Sunday night, police officials said. http://feeds.hindustantimes.com/~r/HT-IndiaSectionPage-Topstories/~3/fUUMziwJedI/story01.htm null
  D/TAG     ( 1901): List Data is called
  D/TAG     ( 1901): Temp is created.......
  D/TAG     ( 1901): RSS Data: title  : Twelve-die-in-Himachal-road-accident description:Twelve people, all belonging to a village in Himachal Pradesh's Chamba district, were killed when a private vehicle skidded off the road and fell into a 700-metre-deep gorge on Sunday night, police officials said. http://feeds.hindustantimes.com/~r/HT-IndiaSectionPage-Topstories/~3/fUUMziwJedI/story01.htm null
  D/TAG     ( 1901): List Data is called
  D/TAG     ( 1901): Temp is created.......
  D/TAG     ( 1901): RSS Data: title  : Twelve-die-in-Himachal-road-accident description:Twelve people, all belonging to a village in Himachal Pradesh's Chamba district, were killed when a private vehicle skidded off the road and fell into a 700-metre-deep gorge on Sunday night, police officials said. http://feeds.hindustantimes.com/~r/HT-IndiaSectionPage-Topstories/~3/fUUMziwJedI/story01.htm null
  </code></pre>
  
  <p>At the end the application is force closed by showing the following logcat:</p>
  
  <pre><code>E/dalvikvm( 1901): Out of memory: Heap Size=24263KB, Allocated=23071KB, Bitmap Size=375KB
  D/AndroidRuntime( 1901): Shutting down VM
  W/dalvikvm( 1901): threadid=1: thread exiting with uncaught exception (group=0x400259f8)
  I/dalvikvm-heap( 1901): Clamp target GC heap from 24.311MB to 24.000MB
  D/dalvikvm( 1901): GC_FOR_MALLOC freed 18016 objects / 939208 bytes in 141ms
  E/AndroidRuntime( 1901): FATAL EXCEPTION: main
  E/AndroidRuntime( 1901): java.lang.OutOfMemoryError
  E/AndroidRuntime( 1901):    at android.text.SpannableStringBuilder.resizeFor(SpannableStringBuilder.java:137)
  E/AndroidRuntime( 1901):    at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:322)
  E/AndroidRuntime( 1901):    at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:275)
  E/AndroidRuntime( 1901):    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:438)
  E/AndroidRuntime( 1901):    at android.text.SpannableStringBuilder.append(SpannableStringBuilder.java:259)
  E/AndroidRuntime( 1901):    at android.text.HtmlToSpannedConverter.characters(Html.java:774)
  E/AndroidRuntime( 1901):    at org.ccil.cowan.tagsoup.Parser.pcdata(Parser.java:994)
  E/AndroidRuntime( 1901):    at org.ccil.cowan.tagsoup.HTMLScanner.save(HTMLScanner.java:614)
  E/AndroidRuntime( 1901):    at org.ccil.cowan.tagsoup.HTMLScanner.scan(HTMLScanner.java:557)
  E/AndroidRuntime( 1901):    at org.ccil.cowan.tagsoup.Parser.parse(Parser.java:449)
  E/AndroidRuntime( 1901):    at android.text.HtmlToSpannedConverter.convert(Html.java:411)
  E/AndroidRuntime( 1901):    at android.text.Html.fromHtml(Html.java:139)
  E/AndroidRuntime( 1901):    at android.text.Html.fromHtml(Html.java:102)
  E/AndroidRuntime( 1901):    at com.mistral.droidcast.SubscriptionActivity$RequestTask.stipHtml(SubscriptionActivity.java:134)
  E/AndroidRuntime( 1901):    at com.mistral.droidcast.SubscriptionActivity$RequestTask.onPostExecute(SubscriptionActivity.java:84)
  E/AndroidRuntime( 1901):    at com.mistral.droidcast.SubscriptionActivity$RequestTask.onPostExecute(SubscriptionActivity.java:1)
  E/AndroidRuntime( 1901):    at android.os.AsyncTask.finish(AsyncTask.java:417)
  E/AndroidRuntime( 1901):    at android.os.AsyncTask.access$300(AsyncTask.java:127)
  E/AndroidRuntime( 1901):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
  E/AndroidRuntime( 1901):    at android.os.Handler.dispatchMessage(Handler.java:99)
  E/AndroidRuntime( 1901):    at android.os.Looper.loop(Looper.java:144)
  E/AndroidRuntime( 1901):    at android.app.ActivityThread.main(ActivityThread.java:4937)
  E/AndroidRuntime( 1901):    at java.lang.reflect.Method.invokeNative(Native Method)
  E/AndroidRuntime( 1901):    at java.lang.reflect.Method.invoke(Method.java:521)
  E/AndroidRuntime( 1901):    at 
  
      com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
      E/AndroidRuntime( 1901):    at 
  
      com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
      E/AndroidRuntime( 1901):    at dalvik.system.NativeStart.main(Native Method)
      W/ActivityManager(  103):   Force finishing activity com.mistral.droidcast/.SubscriptionActivity
  </code></pre>
  
  <p>please give me any other way to achieve it.</p>