public static void Main(string[] args) { //GDNDynamicTests t = new GDNDynamicTests(); //t.EvaluateTest(); if (args.Length != 3) { PrintUsage(); return; } try { XPathDocument doc = new XPathDocument(args[0]); ExsltTransform xslt = new ExsltTransform(); xslt.Load(args[1]); xslt.MultiOutput = false; using (FileStream fs = File.Create(args[2])) { xslt.Transform(doc, null, fs); } } catch (Exception e) { Console.Error.WriteLine("An exception occured: "); Console.Error.WriteLine(e); } }
protected void RunAndCompare(string source, string stylesheet, string result) { XPathDocument doc = new XPathDocument(TestDir + source); ExsltTransform exslt = new ExsltTransform(); exslt.Load(TestDir + stylesheet); StringWriter res = new StringWriter(); exslt.Transform(doc, null, res); StreamReader sr = new StreamReader(ResultsDir + result); string expectedResult = sr.ReadToEnd(); sr.Close(); if (res.ToString() != expectedResult) { Console.WriteLine("Actual Result was {0}", res.ToString()); Console.WriteLine("Expected Result was {0}", expectedResult); } Assert.IsTrue(res.ToString() == expectedResult); }