reader.parse(new InputSource(url.openStream()));
}
public void testValidateImplementation() throws Exception {
SchemaFactory schemaFactory;
try {
schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
} catch (Error e) {
// Some old JDKs don't support XMLSchema validation
return;
} catch (Exception e) {
// Some old JDKs don't support XMLSchema validation
return;
}
Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource("tuscany-sca.xsd"));
ValidatorHandler handler = schema.newValidatorHandler();
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
URL url = getClass().getResource("JavaScriptReference.composite");
XMLReader reader = parserFactory.newSAXParser().getXMLReader();