public static void main(String[] args) {
        try {
            SAXParserFactory factory = SAXParserFactory.newInstance();
            factory.setNamespaceAware(true);
            factory.setValidating(false);
            XMLReader reader = factory.newSAXParser().getXMLReader();
            if (!args[0].contains(":")) {
              args[0] = "file:" + args[0];
            }
            System.err.println(args[0]);
            URL url = new URL(args[0]);
            InputSource in = new InputSource(url.openStream());
            SaxCompiler sc = new SaxCompiler(new OutputStreamWriter(
                    new FileOutputStream(args[1]), "UTF-8"));
            reader.setContentHandler(sc);
            reader.parse(in);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
@see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
src/nu/validator/xml/SaxCompiler.java