Results 1 to 2 of 2

Thread: Need help with "obsolete" code - .Transform

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Need help with "obsolete" code - .Transform

    I have this in a file:

    PHP Code:
            internal XmlTextReader GetXmlReaderFromXPathDoc(XPathDocument xmldocstring TreeNodeXsltSrc)
            {
                
    // Load TreeNodeXsltSrc into XslTransform
                
    XslTransform xslTrans = new XslTransform();
                
    Uri uri = new Uri(Page.Request.UrlTreeNodeXsltSrc);
                
    xslTrans.Load(uri.AbsoluteUri);

                
    // Do transform
                
    MemoryStream stream = new MemoryStream();
                
    xslTrans.Transform(((IXPathNavigable)xmldoc).CreateNavigator(), nullstream);
                
    stream.Position 0;
                return new 
    XmlTextReader(stream);
            } 
    I didn't write this code, it's part of the IE web controls source, and I have to compile this. However, when I try to compile it, I get this:

    'System.Xml.Xsl.XslTransform.Transform(System.Xml.XPath.XPathNavigator,
    System.Xml.Xsl.XsltArgumentList, System.IO.Stream)' is obsolete: 'You
    should pass XmlResolver to Transform() method'
    I cannot figure out how to make this code conform to the 'newer' standards. Can anyone help?

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Need help with "obsolete" code - .Transform

    Thanks, that helped.

    Don't know why you've been banned, but I'd like to rate you when you get back.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width