import javax.xml.validation.*; import javax.xml.XMLConstants; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.*; import javax.xml.parsers.*; import org.w3c.dom.*; import java.io.*; public class SkeemiKontroll{ public static void main(String[] argumendid) throws Exception{ if(argumendid.length!=2){ System.out.println("Kasuta kujul: java SkeemiKontroll skeem.xsd andmefail.xml"); System.exit(0); } Validator validaator=SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"). newSchema(new StreamSource(argumendid[0])).newValidator(); validaator.validate(new StreamSource(argumendid[1])); } }