永远的SKYFEI
喜欢在阳光下,光着脊梁,挥汗如雨地工作,每次回头擦汗,看到的都是成就!

声明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();

posted on 2008-04-18 18:38  skyfei  阅读(2685)  评论(0编辑  收藏  举报