Esempio n. 1
0
  /**
   * When parsing this RSS XML document, this indicates the beginning of an XML tag
   *
   * @param uri
   * @param localName
   * @param qName
   * @param attributes
   * @throws SAXException
   */
  public synchronized void startElement(
      final String uri, final String localName, final String qName, final Attributes attributes)
      throws SAXException {
    super.startElement(uri, localName, qName, attributes);

    if (qName.equals("item")) {
      currentItem = new RSSItem();
    }
  }
Esempio n. 2
0
  /**
   * When parsing this RSS XML document, this indicates the end of an XML tag
   *
   * @param uri
   * @param localName
   * @param qname
   * @throws SAXException
   */
  public void endElement(final String uri, final String localName, final String qname)
      throws SAXException {
    super.endElement(uri, localName, qname);

    if (qname.equals("item")) {
      if (items.size() < maxLength) {
        items.addElement(currentItem);
      }
      currentItem = null;
    }
  }