public void IterateThrough(XmlSchemaElement obj)
        {
            if (obj.RefName.IsEmpty)
            {
                var sg = XmlSchemaExtensions.GetSubstitutionGroupElements(_schemaSet, obj);

                if (obj.IsAbstract && sg.Any())
                {
                    List <XmlSchemaElement> sgList;

                    if (obj.IsAbstract)
                    {
                        sgList = sg.ToList();
                    }
                    else
                    {
                        sgList = sg.ToList();
                        sgList.Add(obj);
                    }

                    _functionalVisitor.StartProcessingSubstitutionGroup(obj.Name);
                    foreach (var element in sgList)
                    {
                        element.Accept(this);
                    }

                    _functionalVisitor.EndProcessingSubstitutionGroup(obj.Name);
                }

                else
                {
                    if (_functionalVisitor.StartProcessing(obj))
                    {
                        obj.Annotation?.Accept(this);

                        if (obj.SchemaTypeName.Namespace != XmlSchema.Namespace)
                        {
                            obj.ElementSchemaType.Accept(this);
                        }
                    }

                    _functionalVisitor.EndProcessing(obj);
                }
            }
            else
            {
                var refElement = XmlSchemaExtensions.GetGlobalElementByName(_schemaSet, obj.RefName);
                if (_functionalVisitor.StartProcessing(obj))
                {
                    refElement.Accept(this);
                }
                _functionalVisitor.EndProcessing(obj);
            }
        }
        public void IterateThrough(XmlSchemaGroupRef obj)
        {
            if (_functionalVisitor.StartProcessing(obj))
            {
                var group = XmlSchemaExtensions.GetGroup(_schemaSet, obj.RefName);

                @group?.Accept(this);
            }

            _functionalVisitor.EndProcessing(obj);
        }
        public void IterateThrough(XmlSchemaComplexType obj)
        {
            if (_functionalVisitor.StartProcessing(obj))
            {
                if (obj.Attributes != null)
                {
                    var en = obj.Attributes.GetEnumerator();
                    while (en.MoveNext())
                    {
                        en.Current.Accept(this);
                    }
                }

                if (obj.ContentModel != null)
                {
                    var complexContent = obj.ContentModel.Content as XmlSchemaComplexContentExtension;
                    if (complexContent != null)
                    {
                        if (complexContent.Attributes != null)
                        {
                            var en = complexContent.Attributes.GetEnumerator();
                            while (en.MoveNext())
                            {
                                en.Current.Accept(this);
                            }
                        }

                        var baseType = XmlSchemaExtensions.GetComplexType(_schemaSet, complexContent.BaseTypeName);
                        baseType.Accept(this);
                        complexContent.Accept(this);
                    }

                    var simpleContent = obj.ContentModel.Content as XmlSchemaSimpleContentExtension;
                    simpleContent?.Accept(this);
                }
                else if (obj.Particle != null)
                {
                    obj.Particle.Accept(this);
                }
            }
            _functionalVisitor.EndProcessing(obj);
        }
        public void IterateThrough(XmlSchemaSimpleContentExtension obj)
        {
            if (_functionalVisitor.StartProcessing(obj))
            {
                if (obj.Attributes != null)
                {
                    var en = obj.Attributes.GetEnumerator();
                    while (en.MoveNext())
                    {
                        en.Current.Accept(this);
                    }
                }

                var baseType = XmlSchemaExtensions.GetComplexType(_schemaSet, obj.BaseTypeName);

                if (baseType != null && obj.BaseTypeName.Namespace != XmlSchema.Namespace)
                {
                    baseType.Accept(this);
                }
            }

            _functionalVisitor.EndProcessing(obj);
        }