XslTransform
Transform 方法將結果輸出到字符串裡有
中辦法
通過System
IO
MemoryStream類來實現
通過System
Text
StringBuilder類來實現
下面是具體的實現方法
System
Xml
Xsl
XslTransform RssXslt = new System
Xml
Xsl
XslTransform();
System
Xml
XmlDocument RssXml = new System
Xml
XmlDocument();
RssXslt
Load(Server
MapPath(
RssReader
xslt
));
RssXml
Load(Server
MapPath(
Rss
xml
));
System
IO
MemoryStream t = new System
IO
MemoryStream();
RssXslt
Transform(RssXml
null
t
null);
string resultString = System
Text
UTF
Encoding
UTF
GetString(t
ToArray());
Response
Write(resultString);
System
Xml
Xsl
XslTransform RssXslt = new System
Xml
Xsl
XslTransform();
System
Xml
XmlDocument RssXml = new System
Xml
XmlDocument();
RssXslt
Load(Server
MapPath(
RssReader
xslt
));
RssXml
Load(Server
MapPath(
Rss
xml
));
System
Text
StringBuilder t = new System
Text
StringBuilder();
RssXslt
Transform(RssXml
null
new System
IO
StringWriter(t)
null);
string resultString = t
ToString();
Response
Write(resultString);
From:http://tw.wingwit.com/Article/program/net/201311/12112.html