Connecting Tech Pros Worldwide Help | Site Map

XslTransform.Transform Arguments Obsolete?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 11th, 2005, 09:46 PM
Anthony Bouch
Guest
 
Posts: n/a
Default XslTransform.Transform Arguments Obsolete?

Can anyone tell me why I receive the following compiler warning after having
recently upgraded to VS.Net 2003 and .Net 1.1?

Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable,
System.Xml.Xsl.XsltArgumentList, System.Xml.XmlWriter)' is obsolete: 'You
should pass XmlResolver to Transform() method'

XPathDocument xmlData = new XPathDocument(memStream);
XslTransform xslTransform = new XslTransform();
xslTransform.Load("invoice.xsl");
xmlWriter = new XmlTextWriter("invoice.doc", null);
xslTransform.Transform(xmlData, null, xmlWriter);
xmlWriter.Flush();
xmlWriter.Close();


(My XML Document is coming from memoryStream that was produced by the
serialization of a class but this is not part of the problem)

?

Regards,

Tony




  #2  
Old November 11th, 2005, 09:46 PM
Oleg Tkachenko
Guest
 
Posts: n/a
Default Re: XslTransform.Transform Arguments Obsolete?

Anthony Bouch wrote:
[color=blue]
> Can anyone tell me why I receive the following compiler warning after having
> recently upgraded to VS.Net 2003 and .Net 1.1?
>
> Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable,
> System.Xml.Xsl.XsltArgumentList, System.Xml.XmlWriter)' is obsolete: 'You
> should pass XmlResolver to Transform() method'[/color]
Because Transform() method you are using is obsolete in 1.1.
[color=blue]
> xslTransform.Transform(xmlData, null, xmlWriter);[/color]
This is obsolete, see
http://msdn.microsoft.com/library/de...formtopic7.asp

You should use this method instead:
http://msdn.microsoft.com/library/de...ormtopic15.asp

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

  #3  
Old November 11th, 2005, 09:46 PM
Anthony Bouch
Guest
 
Posts: n/a
Default Re: XslTransform.Transform Arguments Obsolete?

Thanks Oleg

xslTransform.Transform(xmlData, null, xmlWriter, null);

...does the job (as I don't need a resolver in this case)




"Oleg Tkachenko" <olegt@multiconn.com> wrote in message
news:OQ1kcf9PDHA.304@tk2msftngp13.phx.gbl...[color=blue]
> Anthony Bouch wrote:
>[color=green]
> > Can anyone tell me why I receive the following compiler warning after[/color][/color]
having[color=blue][color=green]
> > recently upgraded to VS.Net 2003 and .Net 1.1?
> >
> > Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable,
> > System.Xml.Xsl.XsltArgumentList, System.Xml.XmlWriter)' is obsolete:[/color][/color]
'You[color=blue][color=green]
> > should pass XmlResolver to Transform() method'[/color]
> Because Transform() method you are using is obsolete in 1.1.
>[color=green]
> > xslTransform.Transform(xmlData, null, xmlWriter);[/color]
> This is obsolete, see
>[/color]
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemxmlxslxsltransformclasstransformtopic7. asp[color=blue]
>
> You should use this method instead:
>[/color]
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemxmlxslxsltransformclasstransformtopic15 .asp[color=blue]
>
> --
> Oleg Tkachenko
> http://www.tkachenko.com/blog
> Multiconn Technologies, Israel
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.