469,935 Members | 1,730 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,935 developers. It's quick & easy.

Strange "Obsolete" message with Transform method

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
1 1646


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.

Similar topics

2 posts views Thread by prabhupr | last post: by
93 posts views Thread by jacob navia | last post: by
28 posts views Thread by charlie | last post: by
169 posts views Thread by JohnQ | last post: by
2 posts views Thread by GB | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.