public void Dump()
        {
            CheckArguments();

            SchemaDumper dumper = new SchemaDumper(_provider, _connectionString);

            dumper.DumpTo(_dumpTo);
        }
Exemple #2
0
	public static void Main (string [] args)
	{
		if (args.Length == 0) {
			Console.WriteLine ("USAGE: xsdump masterlistname");
			return;
		}

		try {
			SchemaDumper.TestDir (args [0], Console.Out);
		} catch (Exception ex) {
			Console.WriteLine (ex);
		}
	}
Exemple #3
0
        public void Dump()
        {
            string constr = ConfigurationManager.AppSettings["SqlServerConnectionString"];

            if (constr == null)
            {
                throw new ArgumentNullException("SqlServerConnectionString", "No config file");
            }

            SchemaDumper dumper = new SchemaDumper(ProviderTypes.SqlServer, constr, "");
            string       output = dumper.Dump();

            Assert.IsNotNull(output);
        }
        public void Dump()
        {
            string constr = ConfigurationManager.AppSettings["MySqlConnectionString"];

            if (constr == null)
            {
                throw new ArgumentNullException("MySqlConnectionString", "No config file");
            }

            SchemaDumper dumper = new SchemaDumper("MySql", constr);
            string       output = dumper.Dump();

            Assert.IsNotNull(output);
        }
Exemple #5
0
	public static void TestDir (string masterlist, TextWriter w)
	{
		FileInfo fi = new FileInfo (masterlist);
		string dirname = fi.Directory.Parent.FullName;

		SchemaDumper d = new SchemaDumper (w);
#if false
		foreach (DirectoryInfo di in new DirectoryInfo (dirname).GetDirectories ())
			foreach (FileInfo fi in di.GetFiles ("*.xsd")) {
				try {
					d.IndentLine ("**** File : " + fi.Name);
					d.DumpSchema (XmlSchema.Read (new XmlTextReader (fi.FullName), null));
				} catch (Exception ex) {
					d.IndentLine ("**** Error in " + fi.Name);
				}
			}
#else
		XmlDocument doc = new XmlDocument ();
		doc.Load (fi.FullName);

		foreach (XmlElement test in doc.SelectNodes ("/tests/test")) {
			// Test schema
			string schemaFile = test.SelectSingleNode ("@schema").InnerText;
			if (schemaFile.Length > 2)
				schemaFile = schemaFile.Substring (2);
			bool isValidSchema = test.SelectSingleNode ("@out_s").InnerText == "1";

			if (!isValidSchema)
				continue;
#endif
			try {
				d.IndentLine ("**** File : " + schemaFile);
				d.depth++;
				XmlTextReader xtr = new XmlTextReader (dirname + "/" + schemaFile);
				d.DumpSchema (XmlSchema.Read (xtr, null));
				xtr.Close ();
			} catch (Exception ex) {
				d.IndentLine ("**** Error in " + schemaFile);
			} finally {
				d.depth--;
			}
		}
	}