声明xml字符串:
string xml = "....";
声明xslt 转换类:
XslCompiledTransform xslt = new XslCompiledTransform();
调用xslt sheet文件:
xslt.Load("XSLTFile1.xslt");
将字符串转成流类型
TextReader tr = new StringReader(xml);
声明XPathDocument 类
XPathDocument xpath = new XPathDocument(tr);
定义写字符串的流类型
TextWriter tw = new StringWriter();
定义xml输出流:
XmlWriter xwriter = XmlWriter.Create(tw);
将xml 转成 html 字符串
xslt.Transform(xpath, xwriter);
WebBrowser输出html:
webBrowser1.DocumentText = tw.ToString();