// Load our XML file into the XmlDocument object.
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.Load(strXmlSrc);
// Load our XSL file into the XslTransform object.
XslTransform myXslDoc= new XslTransform();
myXslDoc.Load(strXslFile);
// Create a StringBuilder and then point a StringWriter at it.
// We'll use this to hold the HTML output by the Transform method.
StringBuilder myStringBuilder = new StringBuilder();
StringWriter myStringWriter = new StringWriter(myStringBuilder);
// Call the Transform method of the XslTransform object passing it
// our input via the XmlDocument and getting output via the StringWriter.
myXslDoc.Transform(myXmlDoc, null, myStringWriter);
// Since I've got the page set to cache, I tag on a little
// footer indicating when the page was actually built.
myStringBuilder.Append("<br><p><em>Cached at: " + DateTime.Now + "</em></p><br>"
// Take our resulting HTML and display it via an ASP.NET
// literal control.
RssHtml.Text = myStringBuilder.ToString();
ERROR MESSAGE是:
The underlying connection was closed: An unexpected error occurred on a receive.
Line 124: // Load our XML file into the XmlDocument object.
Line 125: XmlDocument myXmlDoc = new XmlDocument();
Line 126: myXmlDoc.Load(strXmlSrc);
Line 127:
Line 128: // Load our XSL file into the XslTransform object.