Search in sources :

Example 1 with SchemaWriter

use of com.sun.xml.xsom.impl.util.SchemaWriter in project atlasmap by atlasmap.

the class Dumper method main.

public static void main(String[] args) throws Exception {
    XSOMParser reader = new XSOMParser();
    // set an error handler so that you can receive error messages
    reader.setErrorHandler(new ErrorReporter(System.out));
    // DomAnnotationParserFactory is a convenient default to use
    reader.setAnnotationParser(new DomAnnotationParserFactory());
    try {
        // the parse method can by called many times
        for (int i = 0; i < args.length; i++) reader.parse(new File(args[i]));
        XSSchemaSet xss = reader.getResult();
        if (xss == null)
            System.out.println("error");
        else
            new SchemaWriter(new OutputStreamWriter(System.out)).visit(xss);
        dump(reader.getDocuments());
    } catch (SAXException e) {
        if (e.getException() != null)
            e.getException().printStackTrace();
        else
            e.printStackTrace();
        throw e;
    }
}
Also used : XSOMParser(com.sun.xml.xsom.parser.XSOMParser) XSSchemaSet(com.sun.xml.xsom.XSSchemaSet) DomAnnotationParserFactory(com.sun.xml.xsom.util.DomAnnotationParserFactory) OutputStreamWriter(java.io.OutputStreamWriter) File(java.io.File) SchemaWriter(com.sun.xml.xsom.impl.util.SchemaWriter) SAXException(org.xml.sax.SAXException)

Aggregations

XSSchemaSet (com.sun.xml.xsom.XSSchemaSet)1 SchemaWriter (com.sun.xml.xsom.impl.util.SchemaWriter)1 XSOMParser (com.sun.xml.xsom.parser.XSOMParser)1 DomAnnotationParserFactory (com.sun.xml.xsom.util.DomAnnotationParserFactory)1 File (java.io.File)1 OutputStreamWriter (java.io.OutputStreamWriter)1 SAXException (org.xml.sax.SAXException)1