// create resolver entries to represent the SCA schema. We don't create artifacts
// in the contribution as the XSD schema are only actually loaded on demand
// so as long as they are in the model resolver we are set. We do it on the clone
// so that every copy of the system contribution has the schema
ProcessorContext context = new ProcessorContext(monitor);
XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
List<String> scaSchemas = validationSchema.getSchemas();
for (String scaSchemaLocation : scaSchemas){
try {
URL scaSchemaURL = new URL(scaSchemaLocation);
String namespace = staxHelper.readAttribute(scaSchemaURL, XSD, "targetNamespace");
// if this is the SCA schema store it in the system contribution
if (namespace.equals(Constants.SCA11_TUSCANY_NS)){
// add the schema to the model resolver under the Tuscany namespace
XSDefinition scaSchema = xsdFactory.createXSDefinition();
scaSchema.setUnresolved(true);
scaSchema.setNamespace(namespace);
scaSchema.setLocation(IOHelper.toURI(scaSchemaURL));
scaSchema.setUnresolved(false);
// modelResolver.addModel(scaSchema, context);
} else if (namespace.equals(Constants.SCA11_NS)) {
// we know that the SCA schema's are referenced form the Tuscany schemas so
// register the schema under the SCA namespace too
XSDefinition scaSchema = xsdFactory.createXSDefinition();
scaSchema.setUnresolved(true);
scaSchema.setNamespace(Constants.SCA11_NS);
scaSchema.setLocation(IOHelper.toURI(scaSchemaURL));
scaSchema.setUnresolved(false);
modelResolver.addModel(scaSchema, context);