title: Android XML Parsing using SAXParser
body: <p>I have My RSS File Items :</p>
  
  <pre><code>&lt;item &gt;
  &lt;title&gt;Prasad&lt;/title&gt;
  &lt;link&gt;http://www.tele.com/rssHostDescr.php?hostId=15&lt;/link&gt;
  &lt;guid isPermaLink="false"&gt;http://www.tele.com/rssHostDescr.php?hostId=14&lt;/guid&gt;
  &lt;pubDate&gt;2013-04-10&lt;/pubDate&gt;
  &lt;description&gt;Prasad&lt;/description&gt;
  &lt;media:thumbnail width='66' height='49' url='http://www.tele.com/hos/Panthi-image.jpg'&gt;&lt;/media:thumbnail&gt;
  &lt;/item&gt;
  &lt;item&gt;
  ........................
  &lt;/item&gt;
  
  etc.....................
  </code></pre>
  
  <p>I'm trying to parse the above file,I'm able to get all the information(title,link,date)but my requirement is to get   url attribute value,How to get the URL value from media:thumbnail tag? Could any one help?</p>
  
  <p>here my code:</p>
  
  <pre><code>public class HostsRssHandler extends DefaultHandler {
      private List&lt;HostsProfile&gt; messages;
      private HostsProfile currentMessage;
      private StringBuilder builder;
  
      public List&lt;HostsProfile&gt; getMessages(){
          return messages;
      }
      @Override
      public void characters(char[] ch, int start, int length)
              throws SAXException {
          super.characters(ch, start, length);
          builder.append(ch, start, length);
      }
      @Override
      public void endElement(String uri, String localName, String name)
              throws SAXException {
          super.endElement(uri, localName, name);
          if (this.currentMessage != null){
              if (localName.equalsIgnoreCase("tilte")){
                  currentMessage.setTitle(builder.toString());
              } else if (localName.equalsIgnoreCase("link")){
                  currentMessage.setLink(builder.toString());
              }
                  else if (localName.equalsIgnoreCase("media:thumbnail")){
                      currentMessage.setMediathumbnail(builder.toString());
                  }
               else if (localName.equalsIgnoreCase("pubDate")){
                  currentMessage.setDate(builder.toString());
              }
  
  
              else if (localName.equalsIgnoreCase("item")){
                  messages.add(currentMessage);
              }
              builder.setLength(0);   
          }
      }
  
      @Override
      public void startDocument() throws SAXException {
          super.startDocument();
          messages = new ArrayList&lt;HostsProfile&gt;();
          builder = new StringBuilder();
      }
  
      @Override
      public void startElement(String uri, String localName, String name,
              Attributes attributes) throws SAXException {
          super.startElement(uri, localName, name, attributes);
          if (localName.equalsIgnoreCase("item")){
              this.currentMessage = new HostsProfile();
          }
      }   
  }
  </code></pre>
  
  <p>Note:</p>
  
  <pre><code>else if (localName.equalsIgnoreCase("media:thumbnail")){
                      currentMessage.setMediathumbnail(builder.toString());// During My Program Execution, Here I'm not able to get any value
                  }
  </code></pre>