internal static XmlSchemaComplexType GenerateComplexTypeABIE(GeneratorContext context, XmlSchema schema, IAbie abie)
        {
            // R A4CE, R AF95: a complex type must be defined for each ABIE
            XmlSchemaComplexType complexTypeBIE = new XmlSchemaComplexType();

            // R 9D83: the name of the ABIE must be the DictionaryEntryName with all whitespace and separators
            //         removed. The 'Details' suffix is replaced with 'Type'.
            complexTypeBIE.Name = NDR.TrimElementName(abie.Name);

            var processedProperties = new List <ICctsProperty>();
            // create the sequence for the BBIEs within the ABIE
            XmlSchemaSequence sequenceBBIEs = new XmlSchemaSequence();

            //attributes and associations are mixed in a user defined order
            foreach (var property in abie.Properties)
            {
                if (!processedProperties.Contains(property))
                {
                    AddProperty(property, sequenceBBIEs, context, schema, processedProperties);
                }
            }

            // add the sequence created to the complex type
            complexTypeBIE.Particle = sequenceBBIEs;
            return(complexTypeBIE);
        }
        private static void GenerateComplexTypeForMa(GeneratorContext context, XmlSchema schema, IMa ma)
        {
            var maType = new XmlSchemaComplexType();

            maType.Name = ma.Name + "Type";

            var sequence = new XmlSchemaSequence();

            foreach (IAsma asma in ma.Asmas)
            {
                var rasmaElement = new XmlSchemaElement();
                rasmaElement.Name           = NDR.GetXsdElementNameFromAsma(asma);
                rasmaElement.SchemaTypeName = new XmlQualifiedName(context.NamespacePrefix + ":" +
                                                                   NDR.TrimElementName(asma.AssociatedBieAggregator.Name));
                // R 90F9: cardinality of elements within the ABIE
                rasmaElement.MinOccursString = AdjustBound(asma.LowerBound);
                rasmaElement.MaxOccursString = AdjustBound(asma.UpperBound);
                //add to the sequence
                sequence.Items.Add(rasmaElement);
            }
            //set the sequence as particle of the ma complex type
            maType.Particle = sequence;
            //add the maType to the schema
            schema.Items.Add(maType);
        }
        static XmlSchemaElement CreateAsbieSchemaElement(IAsbie asbie, GeneratorContext context, XmlSchema schema)
        {
            XmlSchemaElement refASBIE = new XmlSchemaElement();

            refASBIE.Name            = NDR.GetXsdElementNameFromAsbie(asbie);
            refASBIE.SchemaTypeName  = new XmlQualifiedName(context.NamespacePrefix + ":" + NDR.TrimElementName(asbie.AssociatedAbie.Name));
            refASBIE.MinOccursString = AdjustBound(asbie.LowerBound);
            refASBIE.MaxOccursString = AdjustBound(asbie.UpperBound);
            return(refASBIE);
        }