QName tempElType = QNameUtils.newQName(tempEl);
// Create the appropriate SchemaReference subclass to represent
// an <import>, an <include> or a <redefine>
SchemaReference sr = null;
String locationURI = null;
if (SchemaConstants.XSD_IMPORT_QNAME_LIST.contains(tempElType))
{
// Create a new import. Don't use the
// ExtensionRegistry.createExtension()
// method as a Schema import is not a WSDL import.
SchemaImport im = schema.createImport();
im.setId(DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_ID));
im.setNamespaceURI(DOMUtils.getAttribute(tempEl, Constants.ATTR_NAMESPACE));
locationURI = DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_SCHEMA_LOCATION);
im.setSchemaLocationURI(locationURI);
// Now the import is set up except for the point to the
// referenced LWS, add the import to the LightWeightSchema.
schema.addImport(im);
}
else
if (SchemaConstants.XSD_INCLUDE_QNAME_LIST.contains(tempElType))
{
// Create a new include. Don't use the
// ExtensionRegistry.createExtension()
// method as a Schema include is not a WSDL import.
sr = schema.createInclude();
sr.setId(DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_ID));
locationURI = DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_SCHEMA_LOCATION);
sr.setSchemaLocationURI(locationURI);
// Now the include is set up except for the pointer to the
// referenced LWS, add the include to the LightWeightSchema.
schema.addInclude(sr);
}
else
if (SchemaConstants.XSD_REDEFINE_QNAME_LIST.contains(tempElType))
{
// Create a new redefine. Don't use the
// ExtensionRegistry.createExtension() method as a Schema redefine
// is not a WSDL import.
sr = schema.createRedefine();
sr.setId(DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_ID));
locationURI = DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_SCHEMA_LOCATION);
sr.setSchemaLocationURI(locationURI);
// Now the redefine is set up except for the pointer to the
// referenced LWS, add the redefine to the LightWeightSchema.
schema.addRedefine(sr);
}