}
XsQName base = restriction.getBase();
if (base == null) {
throw new LocSAXException("Invalid 'restriction': Missing 'base' attribute", getLocator());
}
XSType type = getXSSchema().getType(base);
if (type == null) {
throw new LocSAXException("Invalid 'restriction': Unknown base type " + base, getLocator());
}
if (type.isSimple()) {
throw new LocSAXException("Invalid 'restriction': The base type " + getName() + " is simple.", getLocator());
}
XsTTypeDefParticle particle = restriction.getTypeDefParticle();
XSGroup group = getGroupByParticle(particle);
if (group == null) {
// TODO: Restriction of the ur-type
complexContentParticle = null;
} else {
complexContentParticle = new XSParticleImpl(group);
}
complexContentType = getContentTypeByParticle(particle, group);
attributes = XSAttributeGroupImpl.getAttributes(XSTypeImpl.this, restriction);
restrictedType = type;
} else {
XsQName base = extension.getBase();
if (base == null) {
throw new LocSAXException("Invalid 'extension': Missing 'base' attribute", getLocator());
}
XSType type = getXSSchema().getType(base);
if (type == null) {
throw new LocSAXException("Invalid 'extension': Unknown base type " + base, getLocator());
}
if (type.isSimple()) {
throw new LocSAXException("Invalid 'extension': The base type " + base + " is simple.", getLocator());
}
XSComplexType extendedComplexType = type.getComplexType();
if (extendedComplexType.hasSimpleContent()) {
throw new LocSAXException("Invalid 'extension': The base type " + base + " has simple content.",
getLocator());
}
XsTTypeDefParticle particle = extension.getTypeDefParticle();