示例#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();
    }
  }
示例#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;
    }
  }