Beispiel #1
0
        private void Init(string schemaFile, string xmlFile, string xslType, string baseline, string ver)
        {
            _utils = new Utils(_output);

#pragma warning disable 0618
            if (ver == "v1")
                _xsltV1 = new XslTransform();
#pragma warning restore 0618

            else if (ver == "v2")
                _xsltV2 = new XslCompiledTransform();

            _schemaFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + schemaFile);
            _xmlFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + xmlFile);
            if (baseline == string.Empty)
                _baseline = string.Empty;
            else
                _baseline = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + ver + baseline);

            switch (xslType.ToLower())
            {
                case "basic":
                default:
                    _xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + "schematron-basic.xsl");
                    break;

                case "message":
                    _xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + "schematron-message.xsl");
                    break;

                case "report":
                    _xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + "schematron-report.xsl");
                    break;
            }

            //Delete the output file if it exists
            if (File.Exists(_outFile))
                File.Delete(_outFile);
        }