protected void readElement()
    {
    	//Ignoring whitespaces before start tags.
    	while(!isStartTag()){
    		if(java.lang.Character.isWhitespace(data_.charAt(index_)))
        		index_++;
    		else handler_.fatalError(new RuntimeException("Error: expecting " + "start of element"));
    	}

        // parse start tag
        String name = readStartTag();
        
        // pass element
        handler_.startElement(name, readAttributes());
        
        // check for <... /> construction
        if(data_.charAt(index_) == '/'){
			// skip possible whitespaces
			while (java.lang.Character.isWhitespace(data_.charAt(++index_))) {}
			if(data_.charAt(index_) == '>'){
				handler_.endElement(name);
				return;
			}
        }

        // keep reading in more elements and text until an end tag
        // is encountered
        while (!isEndTag())
        {
            if (isStartTag())
                readElement();
            else
                readText();
        }

        // parse end tag, ensuring it matches most current start tag
        readEndTag(name);
    }