根据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(); }