Hi there,

I'm currently in between two releases and I decided that is was time for some good-old-clean-up-of-the-code.

I've recently looked at the warnings that Visual Studio 2005 generates. And I've found out that I got the following warning:

'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead.

On MSDN there's great article on how to migrate this deprecated class from 1.1 to .NET 2.0:

http://msdn.microsoft.com/en-us/library/66f54faw(VS.80).aspx

This ultimately resulted in my following solution, where url is an url to an XML document and writer is an HtmlTextWriter that will do the rendering:

XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(Server.MapPath("/xsl/google_results.xslt"));
xslt.Transform(new XPathDocument(url), null, writer);

I had to call the following overload method :

public void Transform(
    IXPathNavigable input,
    XsltArgumentList arguments,
    TextWriter results
)

Too bad Microsoft didn't also create the following overload for a TextWriter Frown:

public void Transform(
    IXPathNavigable input,
    TextWriter results
)

Hope this is usefull!

gr,

Robbert
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList