Esempio n. 1
0
        public void RunCompare( string[] args )
        {
            string xsdPath = args[0];
            string comparePath = args[1];
            TextWriter writer;
            if ( args.Length > 2 ) {
                string fileName;
                fileName = args[2];
                writer = new StreamWriter( fileName, false, Encoding.ASCII );
                if( DETAILED ) {
                    Console.SetOut( writer );
                }
            }
            else {
                writer = Console.Out;
            }

            MetaDataSchema metadataSchema = new MetaDataSchema( comparePath );
            SifSchema sifSchema = new SifSchema( xsdPath );
            //sifSchema.WriteExampleXml( "Results.xml" );

            new SchemaComparer().Compare
                ( sifSchema.GetSchemaDefinition(),
                  metadataSchema.GetSchemaDefinition( SifVersion.SIF22 ),
                  new CompareOutput( writer, DETAILED, false ), true );
            writer.Close();

            if ( args.Length > 3 && args[3].Trim().ToLower() == "/autogen" ) {
                // Automatically generate xml for missing objects
                new MetadataUpdater( comparePath ).AddUndefinedObjects
                    ( sifSchema.GetSchemaDefinition(), metadataSchema.GetSchemaDefinitions()[0] );
            }
        }
Esempio n. 2
0
        public void RunCompare(string[] args)
        {
            string     xsdPath     = args[0];
            string     comparePath = args[1];
            TextWriter writer;

            if (args.Length > 2)
            {
                string fileName;
                fileName = args[2];
                writer   = new StreamWriter(fileName, false, Encoding.ASCII);
                if (DETAILED)
                {
                    Console.SetOut(writer);
                }
            }
            else
            {
                writer = Console.Out;
            }



            MetaDataSchema metadataSchema = new MetaDataSchema(comparePath);
            SifSchema      sifSchema      = new SifSchema(xsdPath);

            //sifSchema.WriteExampleXml( "Results.xml" );

            new SchemaComparer().Compare
                (sifSchema.GetSchemaDefinition(),
                metadataSchema.GetSchemaDefinition(SifVersion.SIF22),
                new CompareOutput(writer, DETAILED, false), true);
            writer.Close();


            if (args.Length > 3 && args[3].Trim().ToLower() == "/autogen")
            {
                // Automatically generate xml for missing objects
                new MetadataUpdater(comparePath).AddUndefinedObjects
                    (sifSchema.GetSchemaDefinition(), metadataSchema.GetSchemaDefinitions()[0]);
            }
        }