package com.thaiopensource.xml.dtd.app;

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

import com.thaiopensource.xml.out.CharRepertoire;
import com.thaiopensource.xml.out.XmlWriter;
import com.thaiopensource.xml.util.EncodingMap;
import com.thaiopensource.xml.dtd.om.DtdParser;
import com.thaiopensource.xml.dtd.om.Dtd;
import com.thaiopensource.xml.dtd.parse.DtdParserImpl;

public class Driver {
  public static void main (String args[]) throws IOException {
    DtdParser dtdParser = new DtdParserImpl();
    Dtd dtd = dtdParser.parse(args[0], new FileEntityManager());
    String enc = EncodingMap.getJavaName(dtd.getEncoding());
    BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out,
								 enc));
    CharRepertoire cr = CharRepertoire.getInstance(enc);
    new SchemaWriter(new XmlWriter(w, cr)).writeDtd(dtd);
    w.flush();
  }
}

package com.thaiopensource.xml.dtd.app;

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

import com.thaiopensource.xml.out.CharRepertoire;
import com.thaiopensource.xml.out.XmlWriter;
import com.thaiopensource.xml.util.EncodingMap;
import com.thaiopensource.xml.dtd.om.DtdParser;
import com.thaiopensource.xml.dtd.om.Dtd;
import com.thaiopensource.xml.dtd.parse.DtdParserImpl;

public class Driver {
  public static void main (String args[]) throws IOException {
    DtdParser dtdParser = new DtdParserImpl();
    Dtd dtd = dtdParser.parse(args[0], new FileEntityManager());
    new RelaxNgWriter(null).writeDtd(dtd);
    String enc = EncodingMap.getJavaName(dtd.getEncoding());
    BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out,
								 enc));
    CharRepertoire cr = CharRepertoire.getInstance(enc);
    new SchemaWriter(new XmlWriter(w, cr)).writeDtd(dtd);
    w.flush();
  }
}

Call RelaxNgWriter as a temporary hack.
Call RelaxNgWriter as a temporary hack.


git-svn-id: ca8e9bb6f3f9b50a093b443c23951d3c25ca0913@283 369101cc-9a96-11dd-8e58-870c635edf7a
