Example #1
0
        public void ExecuteFromConfig(CodeGeneratorSection config)
        {
            if (config == null)
            {
                config = Initializer.ConfigRoot;
            }

            foreach (ProcessingEntryElement procElement in config.ProcessEntries.GetAllProcessingEntries())
            {
                XsltArgumentList args = new XsltArgumentList();
                if (config.DefaultSettings != null)
                {
                    if (config.DefaultSettings.Global != null)
                    {
                        this.FillXsltArguments(args, config.DefaultSettings.Global);
                    }
                    if (config.DefaultSettings.XsltMappings != null)
                    {
                        DefaultSettingSetElement dftSettingByXslt = config.DefaultSettings.XsltMappings.GetDefaultSetByXsltExactPath(procElement.ExactXsltFilePath);
                        if (dftSettingByXslt != null)
                        {
                            this.FillXsltArguments(args, dftSettingByXslt);
                        }
                    }
                }
                if (procElement.Parent != null)
                {
                    this.FillParametersToXsltArguments(args, procElement.Parent.SharedParameters);
                }
                this.FillParametersToXsltArguments(args, procElement.Parameters);

                this.Execute(procElement.ExactSourceFilePath, procElement.ExactXsltFilePath, procElement.ExactTargetFileFath, args);
            }
        }
        public static void Initialize(CodeGeneratorSection configRoot)
        {
            if (configRoot == null)
            {
                throw new ArgumentNullException("configRoot");
            }

            _configRoot = configRoot;
        }