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

GetSchema() public method

public GetSchema ( string ns, string e1, string e2 ) : XmlSchema
ns string
e1 string
e2 string
return System.Xml.Schema.XmlSchema
        public XmlSchema GetSchema(string ns, string e1, string e2)
        {
            string xsd = String.Empty;
            if (ns.Equals(String.Empty))
                xsd = "<schema xmlns='http://www.w3.org/2001/XMLSchema'><element name='" + e1 + "'/><element name='" + e2 + "'/></schema>";
            else
                xsd = "<schema xmlns='http://www.w3.org/2001/XMLSchema' targetNamespace='" + ns + "'><element name='" + e1 + "'/><element name='" + e2 + "'/></schema>";

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