3.11 Get Content Handler for SAX

<..String [] className = .....>
 String [] className = node.getAttributes()
                      .getNamedItem( "content-handler" )
                      .getNodeValue()
                      .split(",");
 -_-_-

The constructor of a content handler is provided five arguments:

<..ch := content handler..>
 Class<?> [] argTypes = {
          PrintWriter.class, HashMap.class, Method.class,
          PrintWriter.class, boolean.class };
 <.output stream for sax.>
 Object parmValues[] = new Object[5];
 parmValues[0] = out;
 <.sax scripts.>  parmValues[1] = scripts;
 parmValues[2] = method;
 parmValues[3] = Xtpipes.logWriter;
 parmValues[4] = (Object) Xtpipes.trace;
 Class<?> cls = Class.forName( className[0].trim() );
 Constructor<?> c = cls.getConstructor( argTypes );
 Object ch = (Object) c.newInstance( parmValues );
 -_-_-

<..sax scripts..>
 HashMap <String,Object> scripts = new HashMap <String,Object> ();
 Node script = node.getFirstChild();
 while( script != null ){
   if( script.getNodeType()==Node.ELEMENT_NODE ){
      String element = script.getAttributes().getNamedItem( "element" )
                                        .getNodeValue();
      if( scripts.containsKey(element) ){
         System.err.println(
            "--- Warning --- redfining script: " + element );
      }
      scripts.put( element, (Object) script );
   }
   script = script.getNextSibling();
 }
 -_-_-

<..xtpipes initialization..>+
 Class <?> cls = Xtpipes.class;
 Class<?> [] argTypes = { Node.class, String.class };
 method = cls.getMethod( "execute", argTypes );
 -_-_-

<..xtpipes fields..>+
 private static Method method;
 -_-_-