Passing XmlResolver to Transform() method

csharp United States
  • 17 years ago

    Hi,


    I have a method to render HTML from XSLT. Here is the method:


    /// <summary>
    /// Method that renders HTML from XSLT document
    /// </summary>
    /// <param name="writer"></param>
    protected override void Render(HtmlTextWriter writer)
    {
       XPathDocument xdoc = new XPathDocument(Context.Server.MapPath(sourceFilePath));
       XslTransform xslt = new XslTransform();
       xslt.Load(Context.Server.MapPath(transformFilePath));
       xslt.Transform(xdoc, null, writer);
    }


    I am now getting this warning:


    warning CS0618: 'System.Xml.Xsl.XslTransform.Transform(System.Xml.XPath.IXPathNavigable, System.Xml.Xsl.XsltArgumentList, System.IO.TextWriter)' is obsolete: 'You should pass XmlResolver to Transform() method'


    I need some help resolving this warning. Can you help?


    Kyle

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.” - Donald Knuth