HpToolsLauncher.Helper.CreateHtmlFromXslt C# (CSharp) Method

CreateHtmlFromXslt() public static method

Create html file according to a matching xml
public static CreateHtmlFromXslt ( string xmlPath, string xslPath, string targetFile ) : void
xmlPath string the values xml
xslPath string the xml transformation file
targetFile string the full file name - where to save the product
return void
        public static void CreateHtmlFromXslt(string xmlPath, string xslPath, string targetFile)
        {
            var xslTransform = new XslCompiledTransform();
            //xslTransform.Load(xslPath);
            xslTransform.Load(xslPath, new XsltSettings(false, true), null);

            var sb = new StringBuilder();
            var sw = new StringWriter(sb);
            var xmlWriter = new XhtmlTextWriter(sw);
            xslTransform.Transform(xmlPath, null, xmlWriter);

            File.WriteAllText(targetFile, sb.ToString());
        }