public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException {
  try {
    if (!configMap.containsKey(qName)) {
      skipCharacters=false;
      writer.newLine();
      writer.write("<" + qName);
      for (int i=0; i < attributes.getLength(); i++) {
        writer.write(" " + attributes.getQName(i) + "=\""+ attributes.getValue(i)+ "\"");
      }
      writer.write(">");
    }
 else {
      skipCharacters=true;
    }
  }
 catch (  IOException ioe) {
    throw new SAXException(ioe);
  }
}

public void startElement ( String uri , String localName , String qName , Attributes attributes ) throws SAXException { try { if ( ! configMap . containsKey ( qName ) ) { skipCharacters = false ; writer . newLine ( ) ; writer . write ( "<" + qName ) ; for ( int i = 0 ; i < attributes . getLength ( ) ; i ++ ) { writer . write ( " " + attributes . getQName ( i ) + "=\"" + attributes . getValue ( i ) + "\"" ) ; } writer . write ( ">" ) ; } else { skipCharacters = true ; } } catch ( IOException ioe ) { throw new SAXException ( ioe ) ; } }
implementation for default handler method
