By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

Strange "Obsolete" message with Transform method

P: n/a
I've got two statements in my code that are both generating weird,
weird, weird messages:

The first one was,

Dim document As System.Xml.XmlDocument
Dim navigator As System.Xml.XPath.XPathNavigator
Dim transform As System.Xml.Xsl.XslTransform
..
..
..
navigator = document.CreateNavigator()
transform.Transform(navigator, Nothing, Response.OutputStream)

which generated the following fascinating compiler warning on the call
to Transform:

'Public Sub Transform(input As System.Xml.XPath.XPathNavigator, args As
System.Xml.Xsl.XsltArgumentList, output As System.IO.Stream)' is
obsolete: 'You should pass XmlResolver to Transform() method'

Really! Well, with that fascinating tidbit in mind, I changed the code
as follows:

transform.Transform(New System.Xml.XmlUrlResolver, Nothing,
Response.OutputStream)

And was promptly rewarded with this:

'Public Sub Transform(input As System.Xml.XPath.IXPathNavigable, args
As System.Xml.Xsl.XsltArgumentList, output As System.IO.Stream)' is
obsolete: 'You should pass XmlResolver to Transform() method'

The messages are virtually identical. So, the original code, which I am
trying to use to master XMLHTTP for use with .NET 1.1 (for a legacy
app) is apparently "naughty" because it uses obsolete code, and the
recommended code is naughty because it's obsolete as well.

Suggestions?

Now, if you'll excuse me, the ambulence has arrived. I have to go to
the hospital and have my forehead looked at. I think I have a
concussion from slamming my head on the desk.

Mar 14 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Mike Hofer wrote:

Dim document As System.Xml.XmlDocument
Dim navigator As System.Xml.XPath.XPathNavigator
Dim transform As System.Xml.Xsl.XslTransform navigator = document.CreateNavigator()
transform.Transform(navigator, Nothing, Response.OutputStream)

which generated the following fascinating compiler warning on the call
to Transform:

'Public Sub Transform(input As System.Xml.XPath.XPathNavigator, args As
System.Xml.Xsl.XsltArgumentList, output As System.IO.Stream)' is
obsolete: 'You should pass XmlResolver to Transform() method'


For security reasons there were changes from .NET 1.0 to .NET 1.x which
are documented in the .NET framework documentation, see here
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXslXslTransformClassTransformTopic9. asp>

So you now need an _additional_ parameter, see here
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXslXslTransformClassTransformTopic16 .asp>

transform.Transform(navigator, Nothing, Response.OutputStream,
xmlResolverGoesHere)
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.