} else {
XsTElement element = getXsTElement();
if (isInnerSimpleType()) {
myType = factory.newXSType(this, element.getSimpleType());
} else if (isInnerComplexType()) {
myType = factory.newXSType(this, element.getComplexType());
} else {
XsQName typeName = element.getType();
if (typeName == null) {
throw new LocSAXException("Invalid element: Either of its 'type' or 'ref' attributes or its 'simpleType' or 'complexType' children must be set.",
getLocator());