public static void createASDocConfig(ASDocConfiguration config) throws CompilerException {
  String templatesPath=config.getTemplatesPath();
  String ditaPath=config.getOutput() + "tempdita" + File.separator;
  File ditaDir=new File(ditaPath);
  if (!ditaDir.exists()) {
    ditaDir.mkdirs();
  }
  BufferedWriter writer=null;
  Reader reader=null;
  try {
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(ditaPath + "ASDoc_Config.xml"),"UTF-8"));
    reader=new BufferedReader(new InputStreamReader(new FileInputStream(templatesPath + "ASDoc_Config_Base.xml"),"UTF-8"));
    ASDocConfigHandler h=new ASDocConfigHandler(writer,config);
    InputSource source=new InputSource(reader);
    SAXParserFactory factory=SAXParserFactory.newInstance();
    SAXParser parser=factory.newSAXParser();
    parser.parse(source,h);
  }
 catch (  Exception e) {
    if (Trace.error)     e.printStackTrace();
    CompilerMessage c=new CouldNotCreate("ASDoc_Config.xml",e.getMessage());
    ThreadLocalToolkit.log(c);
    throw c;
  }
 finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException ioe) {
      }
    }
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      IOException ioe) {
      }
    }
  }
}

public static void createASDocConfig ( ASDocConfiguration config ) throws CompilerException { String templatesPath = config . getTemplatesPath ( ) ; String ditaPath = config . getOutput ( ) + "tempdita" + File . separator ; File ditaDir = new File ( ditaPath ) ; if ( ! ditaDir . exists ( ) ) { ditaDir . mkdirs ( ) ; } BufferedWriter writer = null ; Reader reader = null ; try { writer = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( ditaPath + "ASDoc_Config.xml" ) , "UTF-8" ) ) ; reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( templatesPath + "ASDoc_Config_Base.xml" ) , "UTF-8" ) ) ; ASDocConfigHandler h = new ASDocConfigHandler ( writer , config ) ; InputSource source = new InputSource ( reader ) ; SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; SAXParser parser = factory . newSAXParser ( ) ; parser . parse ( source , h ) ; } catch ( Exception e ) { if ( Trace . error ) e . printStackTrace ( ) ; CompilerMessage c = new CouldNotCreate ( "ASDoc_Config.xml" , e . getMessage ( ) ) ; ThreadLocalToolkit . log ( c ) ; throw c ; } finally { if ( writer != null ) { try { writer . close ( ) ; } catch ( IOException ioe ) { } } if ( reader != null ) { try { reader . close ( ) ; } catch ( IOException ioe ) { } } } }
reads the asdoc_config_base . xml from the templates folder and creates a temporary asdoc_config . xml in the outut folder .
