Esempio n. 1
0
        static void Main(string[] args)
        {
            var logs      = new List <ILog>();
            var timedLogs = new List <ITimedLog>();

            timedLogs.Add(new XCRI.Validator.App.Logging.TimedLogToConsole());
            var xmlResolver          = new xr.XmlCachingResolver(new [] { new xr.NullXmlCacheLocation() }, logs, timedLogs);
            var source               = new xr.UriSource(logs, xmlResolver);
            var validatorFactory     = new cv.ValidatorFactory(logs, timedLogs, source);
            var validationModule     = new ValidationModule(logs, timedLogs, validatorFactory);
            var interpreterFactory   = new mi.InterpreterFactory(logs, timedLogs);
            var interpretationModule = new m.InterpretationModule(logs, timedLogs, interpreterFactory);
            var validationService    = new ValidationService <Uri>
                                       (
                System.Globalization.CultureInfo.CurrentUICulture,
                null,
                null,
                logs,
                timedLogs,
                source,
                xmlResolver
                                       );
            var runner = new ValidateRunner
                         (
                timedLogs[0],
                validationService,
                validationModule,
                interpretationModule
                         );

            System.IO.FileInfo fileToValidate               = null;
            System.IO.FileInfo validationModuleLocation     = new FileInfo(@"xml-files\ValidationModules\XCRICAP12.xml");
            System.IO.FileInfo interpretationModuleLocation = new FileInfo(@"xml-files\XmlExceptionInterpretation.xml");
            AnalyseArguments
            (
                args,
                ref fileToValidate,
                ref validationModuleLocation,
                ref interpretationModuleLocation
            );
            runner.FileToValidate               = fileToValidate;
            runner.ValidationModuleLocation     = validationModuleLocation;
            runner.InterpretationModuleLocation = interpretationModuleLocation;
            runner.Run();
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     var logs = new List<ILog>();
     var timedLogs = new List<ITimedLog>();
     timedLogs.Add(new XCRI.Validator.App.Logging.TimedLogToConsole());
     var xmlResolver = new xr.XmlCachingResolver(new [] { new xr.NullXmlCacheLocation() }, logs, timedLogs);
     var source = new xr.UriSource(logs, xmlResolver);
     var validatorFactory = new cv.ValidatorFactory(logs, timedLogs, source);
     var validationModule = new ValidationModule(logs, timedLogs, validatorFactory);
     var interpreterFactory = new mi.InterpreterFactory(logs, timedLogs);
     var interpretationModule = new m.InterpretationModule(logs, timedLogs, interpreterFactory);
     var validationService = new ValidationService<Uri>
     (
         System.Globalization.CultureInfo.CurrentUICulture,
         null,
         null,
         logs,
         timedLogs,
         source,
         xmlResolver
     );
     var runner = new ValidateRunner
         (
             timedLogs[0],
             validationService,
             validationModule,
             interpretationModule
         );
     System.IO.FileInfo fileToValidate = null;
     System.IO.FileInfo validationModuleLocation = new FileInfo(@"xml-files\ValidationModules\XCRICAP12.xml");
     System.IO.FileInfo interpretationModuleLocation = new FileInfo(@"xml-files\XmlExceptionInterpretation.xml");
     AnalyseArguments
         (
         args,
         ref fileToValidate,
         ref validationModuleLocation,
         ref interpretationModuleLocation
         );
     runner.FileToValidate = fileToValidate;
     runner.ValidationModuleLocation = validationModuleLocation;
     runner.InterpretationModuleLocation = interpretationModuleLocation;
     runner.Run();
 }