[唐胡璐] C#将QTP结果(XML+XSL文档)转换为HTML格式

根据QTP的XML结果和在安装目录dat下的xsl文件,把结果转换为HTML格式。

public static void XMLToHTML()  
{  
    XslCompiledTransform xsl = new XslCompiledTransform();  
    xsl.Load(sPShortXSL); // load xsl file  
    XPathDocument xml = new XPathDocument(sResultXML); // Result xml file  
    XmlTextWriter writer = new XmlTextWriter(sPShortHTML, Encoding.GetEncoding("GB2312")); // Encode to GB2312 for display Chinese  
    xsl.Transform(xml, writer); // Complement transfor  
    writer.Close();  
}
原文地址:https://www.cnblogs.com/yongfeiuall/p/4134165.html