Message Oracle LSX-00168 - referring form of ~S must NOT occur at the top level

ERRORreferring form of ~S must NOT occur at the top level
CAUSEThe referring form did not occur within a complex type definition or an attribute group definition.
ACTIONMove the attributeGroup definition to within a complex type definition or an attribute group definition. Or, move the group definition to within a complex type, restriction, extension, choice, or sequence.