} else if (o instanceof XsTAttribute) {
XSAttribute attribute = pObject.getXSSchema().getXSObjectFactory().newXSAttribute(pObject, (XsTAttribute) o);
attribute.validate();
attributes.add(attribute);
} else if (o instanceof XsTAttributeGroupRef) {
XsTAttributeGroupRef agRef = (XsTAttributeGroupRef) o;
XsQName ref = agRef.getRef();
if (ref == null) {
throw new LocSAXException("Invalid attribute group: Missing 'ref' attribute", pObject.getLocator());
}
XSAttributeGroup attributeGroup = pObject.getXSSchema().getAttributeGroup(ref);
if (attributeGroup == null) {