示例#1
0
 //Called when an opening tag is reached, such as <item> or <title>
 @Override
 public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
     if (qName.equals("item"))
         currentItem = new RssItem();
     else if (qName.equals("title"))
         parsingTitle = true;
     else if (qName.equals("link"))
         parsingLink = true;
     else if (qName.equals("description"))
         parsingDescription = true;
     else if (qName.equals("pubDate"))
         parsingPubDate = true;
     else if (qName.equals("media:thumbnail") || qName.equals("media:content") || qName.equals("image")) {
         if (attributes.getValue("url") != null)
             currentItem.setImageUrl(attributes.getValue("url"));
     }
 }