boolean isValid = true;
int numInlineSchemas = schema.length;
Hashtable schemas = new Hashtable();
for(int i = 0; i < numInlineSchemas; i++)
{
InlinedSchema iSchema = schema[i];
URI iSchemaNs = iSchema.getNamespace();
// If the namespace isn't defined this assertion doesn't apply.
if(iSchemaNs == null)
continue;
String ns = iSchemaNs.toString();
if(schemas.containsKey(ns))
{
List schemaList = (List)schemas.get(ns);
XmlSchemaObjectTable elements = iSchema.getSchemaDefinition().getElements();
Iterator elementNames = elements.getNames();
while(elementNames.hasNext())
{
QName elementName = (QName)elementNames.next();
Iterator otherInlineSchemas = schemaList.iterator();
while(otherInlineSchemas.hasNext())
{
if(((InlinedSchema)otherInlineSchemas.next()).getSchemaDefinition().getElementByName(elementName) != null)
{
// Duplicate element defined.
errorReporter.reportError(new ErrorLocatorImpl(), "Schema-1073", new Object[]{elementName, ns}, ErrorReporter.SEVERITY_ERROR);
isValid = false;
}
}
}
XmlSchemaObjectTable types = iSchema.getSchemaDefinition().getSchemaTypes();
Iterator typeNames = types.getNames();
while(typeNames.hasNext())
{
QName typeName = (QName)typeNames.next();
Iterator otherInlineSchemas = schemaList.iterator();