SchemaFactory factory = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
// load a WXS schema, represented by a Schema instance
Source schemaFile = new StreamSource(xsdContent);
Schema schema = factory.newSchema(schemaFile);
// create a Validator instance, which can be used to validate an instance document
Validator validator = schema.newValidator();
// validate the DOM tree
validator.validate(scoure);
resource.setProperty(XSD_STATUS, XSD_VALID);
} catch (Exception e) {
resource.setProperty(XSD_STATUS, XSD_IN_VALID);