private void Write36_XmlSchemaAttribute(string n, string ns, XmlSchemaAttribute o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(XmlSchemaAttribute)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.EscapeName = false;
         base.WriteStartElement(n, ns, o, false, o.Namespaces);
         if (needType)
         {
             base.WriteXsiType("XmlSchemaAttribute", "http://www.w3.org/2001/XMLSchema");
         }
         base.WriteAttribute("id", "", o.Id);
         XmlAttribute[] unhandledAttributes = o.UnhandledAttributes;
         if (unhandledAttributes != null)
         {
             for (int i = 0; i < unhandledAttributes.Length; i++)
             {
                 XmlAttribute node = unhandledAttributes[i];
                 base.WriteXmlAttribute(node, o);
             }
         }
         base.WriteAttribute("default", "", o.DefaultValue);
         base.WriteAttribute("fixed", "", o.FixedValue);
         if (o.Form != XmlSchemaForm.None)
         {
             base.WriteAttribute("form", "", this.Write6_XmlSchemaForm(o.Form));
         }
         base.WriteAttribute("name", "", o.Name);
         base.WriteAttribute("ref", "", base.FromXmlQualifiedName(o.RefName));
         base.WriteAttribute("type", "", base.FromXmlQualifiedName(o.SchemaTypeName));
         if (o.Use != XmlSchemaUse.None)
         {
             base.WriteAttribute("use", "", this.Write35_XmlSchemaUse(o.Use));
         }
         this.Write11_XmlSchemaAnnotation("annotation", "http://www.w3.org/2001/XMLSchema", o.Annotation, false, false);
         this.Write34_XmlSchemaSimpleType("simpleType", "http://www.w3.org/2001/XMLSchema", o.SchemaType, false, false);
         base.WriteEndElement(o);
     }
 }