根据QTP的XML结果和在安装目录dat下的xsl文件,把结果转换为HTML格式。1
2
3
4
5
6
7
8
9public 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();
}
C#将QTP结果(XML+XSL文档)转换为HTML格式
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!
- Post link: http://izheyi.com/2013/06/02/C-将QTP结果-XML-XSL文档-转换为HTML格式/
- Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.