public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {

		if (qName.equalsIgnoreCase("reuters")) {
		
			//create new reuters document.
			document = new ReutersDocument();
			
			//If split attribute is not-used, just whack into training set.
			
			if (attributes.getValue("LEWISSPLIT").compareTo("NOT-USED")!=0) {
				document.setLewis(attributes.getValue("LEWISSPLIT"));
			} else {
				document.setLewis("train");	
			}
			
			//set remaining attributes
			document.setCgi(attributes.getValue("CGISPLIT"));
			document.setoldid(attributes.getValue("OLDID"));
			document.setnewid(attributes.getValue("NEWID"));
			endofdoc = false;
		}

		if (qName.equalsIgnoreCase("title")) {
			title = true;
		}

		if (qName.equalsIgnoreCase("dateline")) {
			dateline = true;
		}

		if (qName.equalsIgnoreCase("body")) {
			body = true;
			bodypresent = true;
		}
		
		if (qName.equalsIgnoreCase("topics")) {
			topics = true;
		}
		
		//"d" contains the names of topics
		if (qName.equalsIgnoreCase("d")) {
			d = true;
		}
		
		//we do not care about places, but we are using this to prevent places from occurring in the topic list
		if (qName.equalsIgnoreCase("places")) {
			topics = false; 
			places = true;
		}

	}