@Override
	public void endElement(String uri, String localName, String qName)
			throws SAXException {
	//	System.out.println("Ending -->" + qName);
		try {
			if (currenttag.equals(TagName.ID) && isFirst) {
				pageid = sb.toString();
				currentPage.setId(pageid);
				isFirst = false;
				//IndexingTools.init();
			} else if (qName.equals(TagName.TITLE)) {
				currentPage.setTitle(sb);
			} else if (qName.equals(TagName.TEXT)) {
				currentPage.setBodytext(sb);
			} else if (qName.equals(TagName.PAGE)) {
			//	System.out.println("Page end");
				// sb.setLength(0);
				IndexingTools.treatPage(currentPage);
			} else if(qName.equalsIgnoreCase(TagName.MEDIAWIKI) || qName.equalsIgnoreCase(TagName.FILE)) {
				System.out.println("End of media file Tag");
				IndexingTools.fileend();
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
		}
 		// System.out.println("String "+sb.toString());
		// super.pendElement(uri, localName, qName);
	}