public static void main(String[] args) { validate(); }
public static void validate() { try { SchemaValidation demo = new SchemaValidation(); // Give the xml and schema name InputStream xmlString = demo.getClass().getResourceAsStream("GBAInit.xml"); InputStream schemaStr = demo.getClass().getResourceAsStream("GBAInitSchema.xsd");
// use autodetection of schemas VerifierFactory factory = new com.sun.msv.verifier.jarv.TheFactoryImpl(); Schema schema = factory.compileSchema(schemaURI);