public override string ToString() { text elementoComplejo = ""; text simpleContent = ""; elementoComplejo = "<xs:complexType"; if (Nombre != null) { elementoComplejo &= " name=\"" + nombre + "\""; } elementoComplejo &= ">"; if (IsTextOnly) { elementoComplejo &= "xs:simpleContent>"; simpleContent = SimpleContent.ToString(); simpleContent.Remove("</xs:restriccion>"); elementoComplejo &= simpleContent; //con sus restricciones } else if (!IsEmpty) { elementoComplejo = "<xs:complexType"; if (Nombre != null) { elementoComplejo &= " name=\"" + nombre + "\""; } elementoComplejo &= " mixed=\"" + mixed.ToString().ToLower() + "\"><xs:complexContent>"; if (tipoXsdBase != null) { elementoComplejo &= "<xs:extension base=\"" + tipoXsdBase + "\">"; } elementoComplejo &= "<" + orden.ToString().ToLower() + ">"; foreach (KeyValuePair <ElementoXsdOrdenado, string> elemento in elementos) { elementoComplejo &= elemento.Value; } elementoComplejo &= "</" + orden.ToString().ToLower() + ">"; if (IsExtensibleElement) { elementoComplejo &= "<xs:any minOccurs=\"0\"/>"; } } foreach (KeyValuePair <AtributoXsd, string> atributo in atributos) { elementoComplejo &= atributo.Value; } if (tipoXsdBase != null && !IsEmpty && !IsTextOnly) { elementoComplejo &= "</xs:extension>"; } if (IsExtensibleAttribute) { elementoComplejo &= "<xs:anyAttribute/>"; } if (!IsEmpty && !IsTextOnly) { elementoComplejo &= "</xs:complexContent>"; } if (IsTextOnly) { elementoComplejo &= "</xs:restriccion>"; elementoComplejo &= "</xs:simpleContent>"; } elementoComplejo &= "</xs:complexType>"; return(elementoComplejo); }