ModelGroupBinding groupBinding = schemaBinding.getGroup(groupQName);
assertNotNull("Group " + groupQName + " exists in the schema binding.", groupBinding);
}
*/
XSNamedMap types = xsSchema.getComponents(XSConstants.TYPE_DEFINITION);
for (int i = 0; i < types.getLength(); ++i)
{
XSTypeDefinition xsType = (XSTypeDefinition) types.item(i);
if (IGNORED_NS.contains(xsType.getNamespace()))
continue;
QName typeQName = new QName(xsType.getNamespace(), xsType.getName());
if(ignoredTypes.contains(typeQName))
continue;
TypeBinding typeBinding = schemaBinding.getType(typeQName);
if (typeBinding == null)
{
boolean ignoreIfNotFound = false;
if (xsType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE)
{
ignoreIfNotFound = true;
}
else
{
XSComplexTypeDefinition xsComplexType = (XSComplexTypeDefinition) xsType;
if (xsComplexType.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE)
{
XSObjectList attributeUses = xsComplexType.getAttributeUses();
if(attributeUses.getLength() == 0)
{
ignoreIfNotFound = true;
}
else if (attributeUses.getLength() == 1)
{
XSAttributeUse xsAttrUse = (XSAttributeUse) attributeUses.item(0);
XSAttributeDeclaration xsAttr = xsAttrUse.getAttrDeclaration();
if(xsAttr.getNamespace() == null && "id".equals(xsAttr.getName()))
ignoreIfNotFound = true;
}
}
}
if(!ignoreIfNotFound)
{
if(trace)
{
log.trace("SchemaBinding global types: ");
for (Iterator<TypeBinding> iter = schemaBinding.getTypes(); iter.hasNext();)
{
TypeBinding type = iter.next();
if(!IGNORED_NS.contains(type.getQName().getNamespaceURI()))
log.trace("- " + type.getQName());
}
}
fail("Type " + typeQName + " defined in schema binding.");
}
}
else
{
assertEquivalent(xsType, typeBinding);
}
}
XSNamedMap elements = xsSchema.getComponents(XSConstants.ELEMENT_DECLARATION);
for (int i = 0; i < elements.getLength(); ++i)
{
XSElementDeclaration xsElement = (XSElementDeclaration) elements.item(i);
if (IGNORED_NS.contains(xsElement.getNamespace()))
continue;
QName elementQName = new QName(xsElement.getNamespace(), xsElement.getName());
ElementBinding elementBinding = schemaBinding.getElement(elementQName);
assertNotNull("ElementBinding " + elementQName + " exists", elementBinding);