if (xsparticle != null)
{
XSTerm xsterm = xsparticle.getTerm();
if (xsterm instanceof XSModelGroup)
{
XSModelGroup xsm = (XSModelGroup)xsterm;
XSObjectList xparts = xsm.getParticles();
int length = xparts.getLength();
XSTypeDefinition baseType = type.getBaseType();
if (baseType instanceof XSComplexTypeDefinition && ((XSComplexTypeDefinition)baseType).getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
{
XSTerm baseTerm = ((XSComplexTypeDefinition)baseType).getParticle().getTerm();
if (isExceptionType && baseTerm instanceof XSModelGroup)
{
typeNameToBaseVARList.put(type.getName(), createVARsforXSModelGroup((XSModelGroup)baseTerm, schema, type));
}
// HACK - The only way to know what elements are local to the subclass, and not inherited, is to compare to the base class
// THIS TIES US TO XERCES
if (baseType instanceof XSComplexTypeDefinition == false || ((XSComplexTypeDefinition)baseType).getParticle().getTerm() == xsterm)
return;
}
XSParticle xspar;
if (baseType instanceof XSComplexTypeDefinition && ((XSComplexTypeDefinition)baseType).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
{
// If the base type is empty there will not have been a particle to ignore.
xspar = xsparticle;
}
else
{
xspar = (XSParticle)xparts.item(length - 1);
}
XSTerm xsparTerm = xspar.getTerm();
if (xsparTerm instanceof XSModelGroup)
{
XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
}
else if (xsparTerm instanceof XSElementDeclaration)
vars.addAll(createVARforXSElementDeclaration(xsparTerm, schemautils.isArrayType(xspar), schema, type));