public void CompileTestMultipleFiles() { // // Two XSLs in one file, using a list to add them // string path = _path; string assemblyName = "MyNameSpace"; string dllFile = string.Format("{0}.dll", assemblyName); string fullPath = string.Format("{0}/{1}", path, dllFile); string classname = "MyNameSpace.Class"; string classname2 = "MyNameSpace.Class2"; Dictionary <string, string> filelist = new Dictionary <string, string>(); filelist.Add(classname, path + "example.xslt"); filelist.Add(classname2, path + "example2.xslt"); XslCompiler compiler = new XslCompiler(path, dllFile); compiler.CompileFromFiles(filelist); string xml = File.ReadAllText(MapPath("/example.xml")); string result = TransformWithAssembly(fullPath, classname2, xml); }
public void CompileTestMultiple() { string path = _path; string assemblyName = "MyNameSpace"; string dllFile = string.Format("{0}.dll", assemblyName); string fullPath = string.Format("{0}/{1}", path, dllFile); string classname = "MyNameSpace.Class"; string classname2 = "MyNameSpace.Class2"; // This would usually come from the database string xsl1 = File.ReadAllText(MapPath("/example.xslt")); string xsl2 = File.ReadAllText(MapPath("/example2.xslt")); Dictionary <string, string> classList = new Dictionary <string, string>(); classList.Add(classname, xsl1); classList.Add(classname2, xsl2); XslCompiler compiler = new XslCompiler(path, dllFile); compiler.CompileMultiple(classList); string xml = File.ReadAllText(MapPath("/example.xml")); string result = TransformWithAssembly(fullPath, classname2, xml); }
public void CompileTestSingle() { string path = _path; string assemblyName = "MyNameSpace"; string dllFile = string.Format("{0}.dll", assemblyName); string fullPath = string.Format("{0}/{1}", path, dllFile); string classname = "MyNameSpace.Class"; // This would usually come from the database string xsl = File.ReadAllText(MapPath("/example.xslt")); XslCompiler compiler = new XslCompiler(path, dllFile); compiler.Compile(xsl, classname); string xml = File.ReadAllText(MapPath("/example.xml")); string result = TransformWithAssembly(fullPath, classname, xml); }
public void CompileTestSingleFile() { // // Two XSLs in one file // string path = _path; string assemblyName = "MyNameSpace"; string dllFile = string.Format("{0}.dll", assemblyName); string fullPath = string.Format("{0}/{1}", path, dllFile); string classname = "MyNameSpace.Class"; string classname2 = "MyNameSpace.Class2"; XslCompiler compiler = new XslCompiler(path, dllFile); compiler.CompileFromFile(MapPath("/example.xslt"), classname); compiler.CompileFromFile(MapPath("/example2.xslt"), classname2); string xml = File.ReadAllText(MapPath("/example.xml")); string result = TransformWithAssembly(fullPath, classname2, xml); }
public void CompileTestMultipleFiles() { // // Two XSLs in one file, using a list to add them // string path = _path; string assemblyName = "MyNameSpace"; string dllFile = string.Format("{0}.dll", assemblyName); string fullPath = string.Format("{0}/{1}", path, dllFile); string classname = "MyNameSpace.Class"; string classname2 = "MyNameSpace.Class2"; Dictionary<string, string> filelist = new Dictionary<string, string>(); filelist.Add(classname, path + "example.xslt"); filelist.Add(classname2, path + "example2.xslt"); XslCompiler compiler = new XslCompiler(path, dllFile); compiler.CompileFromFiles(filelist); string xml = File.ReadAllText(MapPath("/example.xml")); string result = TransformWithAssembly(fullPath, classname2, xml); }
public void CompileTestMultiple() { string path = _path; string assemblyName = "MyNameSpace"; string dllFile = string.Format("{0}.dll", assemblyName); string fullPath = string.Format("{0}/{1}", path, dllFile); string classname = "MyNameSpace.Class"; string classname2 = "MyNameSpace.Class2"; // This would usually come from the database string xsl1 = File.ReadAllText(MapPath("/example.xslt")); string xsl2 = File.ReadAllText(MapPath("/example2.xslt")); Dictionary<string, string> classList = new Dictionary<string, string>(); classList.Add(classname, xsl1); classList.Add(classname2, xsl2); XslCompiler compiler = new XslCompiler(path, dllFile); compiler.CompileMultiple(classList); string xml = File.ReadAllText(MapPath("/example.xml")); string result = TransformWithAssembly(fullPath, classname2, xml); }