/*
 * Class_1.java
 *
 * Created on June 5, 2001, 6:10 PM
 */

import org.xml.sax.*;
import java.util.Hashtable;


/**
 * This class is the custom handler
 * for XSLT transformation. Other than behaving
 * like normal SAXHandlers, it returns the list
 * of the elements of the transformed XML file
 * and their value
 * @author  Marco Mistroni
 * @version NET/MIA/CBS/SSA
 */
public class ICESAXOutputHandler implements DocumentHandler {

      private Hashtable _contents;
      private StringBuffer _buffer;

      public Hashtable getContents() {
          return _contents;
      }

	public void processingInstruction(String a, String b) {}
	public void ignorableWhitespace(char[] ch, int a, int b) {}
      public void setDocumentLocator(org.xml.sax.Locator locator) {}
	public void startDocument() throws SAXException {
          _contents = new Hashtable();
      }

      public void endDocument() throws SAXException { }

      public void startElement(String name, AttributeList attributes) {
          _buffer = new StringBuffer();
      }      

      public void characters(char[] ch, int off, int len) throws SAXException {
          _buffer.append(ch, off, len);
      }

      public void endElement(String name) {
          _contents.put(name, _buffer.toString());
      }
}




