package com.thaiopensource.xml.dtd;

import java.io.IOException;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;

public class Driver {
  public static void main (String args[]) throws IOException {
    new SchemaWriter(new XmlWriter(new BufferedWriter(new OutputStreamWriter(System.out)))).writeDtd(new Dtd(args[0]));
  }
}

@@ -218,39 +218,27 @@
     
-new SchemaWriter(new XmlWriter(
+BufferedWriter w = 
 new 
@@ -287,16 +287,54 @@
 em.out))
+;%0A    new SchemaWriter(new XmlWriter(w
 )).write
@@ -356,14 +356,29 @@
 s%5B0%5D));%0A
+    w.flush();%0A
   %7D%0A%7D%0A

Flush writer.