473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Update XslTransform to XslCompiledTransform Problem

With VS2005 I see that the XslTransform class has been deprecated and
XslCompiledTransform has replaced it. I am having issues with trying to get
the new class to work how it did with the old. I would appreciate if
someone could tell me how to replace the following code with the new class.
Mainly, I just don't know how to pass my evidence object into the new class
but feel that I am consfused by the whole structure at the moment.

Thanks,

Matt

Dim xslArgs As New XsltArgumentList
Dim xslXForm As New XslTransform
Dim svResolver As New CustomResolver
Dim xslt As String
Dim ms As New MemoryStream
Dim sr As New StreamReader(ms)
Dim clsExt As New XslExtensions
Dim evidence As System.Security.Policy.Evidence =
XmlSecureResolver.CreateEvidenceForUrl("D:\Sorvive Apps\XSL\")

'-- Retreive XSL
xslt = RetrieveXSL(strSenderID, strReceiverID, strPipType, strPipName,
strTranID)

'-- Pass Sorvive Extension Class to XSL
Try
Me.xslArgs.AddExtensionObject("urn:sorvive-extension", clsExt)
Catch ex As ArgumentException
Logging.WriteLine("*** Error on XSL Extension ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
End Try

'-- Load XSL into Processor
Try
xslXForm.Load(New XmlTextReader(New StringReader(xslt)), svResolver,
evidence)
Catch ex As XsltException
Logging.WriteLine("*** Error During XSL Load ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
Catch ex As Exception
Logging.WriteLine("*** Error During XSL Load ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
End Try

'-- Transform XML Document
Try
xslXForm.Transform(xml, Me.xslArgs, ms, svResolver)
Catch ex As Exception
Logging.WriteLine("*** Error During Translation ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
End Try
Dec 5 '05 #1
0 1188

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cody | last post by:
Iam using Beta2 of VS2005 and got this strange message: Warning 1 'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been deprecated. Please use System.Xml.Xsl.XslCompiledTransform...
3
by: Eckhard Schwabe | last post by:
when switching from the old "XslTransform " to "XslCompiledTransform" I notice a difference in the handling of whitespace. I need to transform a XML file which contain tabs (\t), and which remain...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a > b)...
1
by: Praveen | last post by:
Have a common function in Javascript which do transform for all .xsl's. XSL object is loaded like this. var xslobj=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.4.0"); xslobj.async = false;...
1
by: Mark | last post by:
I'm getting the error "The URI scheme is too long." in the code below. What is URI in this context? The XSL or the XML being transformed? Thanks! -Mark StringBuilder sb = new...
3
by: Andy Fish | last post by:
Hi, From reading the documentation, I get the impression that XslCompiledTransform should be faster than XslTransform on my test with a large complex document and a large complex XSLT, the...
2
by: steve.nickels | last post by:
Hello. I'm in the midst of moving a web application from ASP.NET 1.1 to ASP.NET 2.0 (framework 3.0), and as part of this move, I am told by Visual Studio that the XslTransform object is now...
9
by: WT | last post by:
Hello, I have code created with .net 1.0 and migrated to 3.5. Form 2.0 the XslTransform class is obsolete and the vs2008 compiler generates warnings that these classes are absolete suggesting to...
0
by: bryhi | last post by:
Here is the code you can past in your console application to see the differences. I need to know how to get this to work correctly. #pragma warning disable // because we are using a depricated...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.