@Override
  public void endElement(String uri, String name, String qName) throws SAXException {
    try {
      if (fArticle == null) {
        if (fSiteinfo != null) {
          if (WIKIPEDIA_NAMESPACE.equals(qName) && fNamespaceKey != null) {
            fSiteinfo.addNamespace(fNamespaceKey, getString());
          } else if ("sitename".equals(qName)) {
            fSiteinfo.setSitename(getString());
          } else if ("base".equals(qName)) {
            fSiteinfo.setBase(getString());
          } else if ("generator".equals(qName)) {
            fSiteinfo.setGenerator(getString());
          } else if ("case".equals(qName)) {
            fSiteinfo.setCharacterCase(getString());
          }
        }
      } else {
        if (WIKIPEDIA_PAGE.equals(qName)) {
        } else if (WIKIPEDIA_TEXT.equals(qName)) {
          fArticle.setText(getString());
          fArticleFilter.process(fArticle, fSiteinfo);
          // emit(wikiText);
        } else if (WIKIPEDIA_TITLE.equals(qName)) {
          fArticle.setTitle(getString(), fSiteinfo);
        } else if (WIKIPEDIA_TIMESTAMP.equals(qName)) {
          fArticle.setTimeStamp(getString());
        } else if (!fRevision && WIKIPEDIA_ID.equals(qName)) {
          // get the id from wiki page, not the id from the revision
          fArticle.setId(getString());
        }
      }
      fData = null;
      // fAttributes = null;

    } catch (RuntimeException re) {
      re.printStackTrace();
    }
  }