System.Xml.Tests.TC_SchemaSet_GlobalTypes.GetSchema C# (CSharp) Method

GetSchema() public method

public GetSchema ( string ns, string type1, string type2 ) : XmlSchema
ns string
type1 string
type2 string
return System.Xml.Schema.XmlSchema
        public XmlSchema GetSchema(string ns, string type1, string type2)
        {
            string xsd = String.Empty;
            if (ns.Equals(String.Empty))
                xsd = "<schema xmlns='http://www.w3.org/2001/XMLSchema'><complexType name='" + type1 + "'><sequence><element name='local'/></sequence></complexType><simpleType name='" + type2 + "'><restriction base='int'/></simpleType></schema>";
            else
                xsd = "<schema xmlns='http://www.w3.org/2001/XMLSchema' targetNamespace='" + ns + "'><complexType name='" + type1 + "'><sequence><element name='local'/></sequence></complexType><simpleType name='" + type2 + "'><restriction base='int'/></simpleType></schema>";

            XmlSchema schema = XmlSchema.Read(new StringReader(xsd), null);
            return schema;
        }